Microsoft
70-519 · Question #228
You are designing an ASP.NET MVC 2 application. You need to centralize the logic for handling and logging unhandled exceptions. Which approach should you recommend?
The correct answer is C. Decorate all controllers with a custom Handle Error attribute. See the full explanation below for the reasoning.
Question
You are designing an ASP.NET MVC 2 application. You need to centralize the logic for handling and logging unhandled exceptions. Which approach should you recommend?
Options
- AUse try and catch on every method.
- BOverride the One Exception method of each controller.
- CDecorate all controllers with a custom Handle Error attribute
- DDecorate all controllers with the default Handle Error attribute,
How the community answered
(26 responses)- A4% (1)
- B8% (2)
- C85% (22)
- D4% (1)
Community Discussion
No community discussion yet for this question.