Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The question title may not be correct. I have worked in a very big ASP.NET web a

ID: 650556 • Letter: T

Question

The question title may not be correct.

I have worked in a very big ASP.NET web application (without using MVC), there I used a simple error handling strategy :

Enclose every statement in try..catch block

Have a error label on each page at the very top

If any exception occurs then show the error description on the Error Label.

Now I am switching to a new project where MVC 3 framework is to be used, so I came across ELMAH. It is indeed a nice tool for error handling and logging. But as I read from many sites, it basically logs unhandled exceptions.

If I use the same strategy that every statement in try..catch block and then show the error message on the page at the top, then where does ELMAH sit, how will it log the exception? Which exception will it log if I am not putting a single statement outside try..catch block. So there is no scope for the unhandled exception.

Explanation / Answer

ELMAH is a module to be used with ASP.NET or ASP.NET/MVC.

I suggest always using it. It will log any unhandled exceptions - the ones you think you have handled, but haven't, or the ones where your normal logging fails.

You may believe there is no scope for unhandled exceptions - you are wrong.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote