Create custome Handler in exception application block

Topics: Exception Handling Application Block
Feb 7, 2010 at 4:47 PM


I'm using the WCF Exception Shielding ability for converting an exception to fault exception before I return it to the client.

I want to create for this policy, a custom handler, that will log(using my code) the original exception before the convertion.

My code is:


    public class myExceptionLoggingHandler : IExceptionHandler


        public myExceptionLoggingHandler(NameValueCollection collection)



        public System.Exception HandleException(System.Exception exception, Guid handlingInstanceId)



//here I want to use my code to log the original exception that was raised (not the fault exception)


            return exception;





Can I get the original exception here?




Feb 7, 2010 at 4:53 PM

Its ok, I've got it.