Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of Try Catch Block with ELMAH

Since ELMAH logs UNHANDLED exceptions and I want to log all errors via ELMAH, does that mean I should not be using try-catch block anymore anywhere on my code? If I do not use it, it will show the yellow screen of death, which I believe I can be handled through the custom error pages.

So, I think try-catch block will be useless if you use ELMAH, am I right? If not, what are the use cases of using try catch with ELMAH?

like image 359
Chris Avatar asked Dec 06 '25 21:12

Chris


1 Answers

With ELMAH you can catch errors, handle them and still log the issue using ErrorSignal. http://blog.elmah.io/how-to-log-errors-to-elmah-programmatically/

like image 54
Steve Greene Avatar answered Dec 08 '25 11:12

Steve Greene



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!