This is quite an open ended question - there are ways to handle different types of exceptions but it really depends what you want to do and what you're doing.
This page has some details on how to be notified of exceptions from either controllers or from an ApiController. They won't always let you catch the exception but have a read.
How to catch all unhandled exceptions?
Hi, is it possible to catch all exceptions in one place, so I can log them? Thank you!
Hi Cosmin,
This is quite an open ended question - there are ways to handle different types of exceptions but it really depends what you want to do and what you're doing.
This page has some details on how to be notified of exceptions from either controllers or from an ApiController. They won't always let you catch the exception but have a read.
https://stackify.com/csharp-catch-all-exceptions/
Cheers,
David
Thanks for your reply, David.
In the end I found a post on this forum which had a working solution:
https://our.umbraco.com/forum/developers/extending-umbraco/53344-Application_Error-and-Globalasaxcs#comment-201419
Global.asax markup:
Global.asax codebehind:
is working on a reply...