Exception Handling using Ent Lib 6.0

Topics: Enterprise Library Core, Exception Handling Application Block
Dec 10, 2013 at 2:33 AM
Am having a requirement where i would require to access REST services built in Java in my .NET Application.

Can you please point me to the best practises in handling exceptions in these scenerio

Thanks in Advance

Jonathan Rufus
Dec 16, 2013 at 8:27 AM
Are you calling the the REST services from the browser? If so, then the Exception Handling Block wouldn't come into play. As a service consumer, I would say pick an approach that works with the API and aligns with your requirements (functional and non-functional) and use that approach consistently.

If you are receiving exceptions back from the REST service, you will probably have to write some custom handlers because the exception information could be conveyed using HTTP status codes whereas the Exception Handling Application Block defines handlers based on an exception type. Also, the API response might not actually end up being translated to a .NET exception at all so that wouldn't fit well with the design of the block either.

Randy Levy
Enterprise Library support engineer
Support How-to