WCF ErrorHandler

后端 未结 2 1304
心在旅途
心在旅途 2021-01-27 09:05

I have read several documentations about building custom ErrorHandler (by inheriting from IErrorHandler). Unfortunately, I have several doubts about how doing it.

The pr

2条回答
  •  终归单人心
    2021-01-27 09:47

    I had implemented a handler at one point to do logging of exceptions in the HandleError() and to do Exception-to-Fault translations in the ProvideFault(). This worked fairly well for me for awhile.

    However I have since stopped using the IErrorHandler as I found that it wouldn't get fired on all exceptions. I believe that it was a System.Security.SecurityException that was passing through that wouldn't get caught by this code. It was like WCF special cased it and just passed it straight to the client. This made me a bit nervous as I started wondering what else I wasn't catching in this supposedly catch-all interface.

提交回复
热议问题