开发者

WCF FaultException Without Sending StackTrace

开发者 https://www.devze.com 2023-01-22 16:13 出处:网络
开发者_如何学运维I have some WCF services with predefined FaultContract attributes. When the FaultException<TDetail> exceptions are thrown, they\'re sending StackTrace, Source and other potentia
开发者_如何学运维

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消