Question

I want to catch all unhandled exceptions thrown in a remote object on the server and log them there before I translate them into some custom exception so that specific exceptions do not cross the client/server boundary.

I think I have to use a custom channel sync, but can anyone confirm this and/or have any other advice to give?

Was it helpful?

Solution 2

After finding Eliyahu Baker's helpful blog post and reading chapter 12 of Rammer's Advanced .NET Remoting I wrote a custom channel sink that does what I want. This intercepts any exception and logs it locally before sending it on to the client.

Ideally, I'd like to log the exception and raise a more generic one for the client, but I haven't cracked that nut yet.

OTHER TIPS

I would use the Microsoft Enterprise Library Exception Handling app block -- it lets you handle errors and convert specific types of exception to a different type of exception before rethrowing to the client.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top