Is it possible to use Elmah instead of try / catch?

I am using Elmah for MVC application and my question is

Wrong practice not to write try catch statements when using Elmah?

+4
source share
1 answer

ELMAH is used to register unhandled exceptions. If you can handle this exception, I would strongly recommend that you do so.

If you still want to log exceptions in ELMAH, you can do this:

try { ... } catch (Exception e) { Elmah.ErrorSignal.FromCurrentContext().Raise(e) } 
+10
source

Source: https://habr.com/ru/post/1436333/


All Articles