Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF FaultException Without Sending StackTrace

I have some WCF services with predefined FaultContract attributes. When the FaultException<TDetail> exceptions are thrown, they're sending StackTrace, Source and other potentially unsave information.

Is it possible to return only:

  • Detail (from the generic TDetail)
  • FaultMessage
  • FaultCode
  • (and possibly) FaultReason
like image 724
reifnir Avatar asked Oct 28 '10 19:10

reifnir


1 Answers

Have you tried rolling your own fault exception using IErrorHandler? Also make sure in your app config file, the IncludeExceptionDetailInFaults attribute is set to false and, this might be helpful for best pratices.

like image 146
Terrance Avatar answered Nov 13 '22 17:11

Terrance