Do you present the user with a nice error screen? (Web Only)
  v5.0 Posted at 8/09/2014 10:39 AM by Drew Robson

​​​Your users should never see the “yellow screen of death” in ASP.NET. Errors should be caught, logged and a user-friendly screen displayed to the user.

This last part is done by specifying the customErrors element in the web.config file.

This will activate ASP.NET’s built in error page (e.g. MVC’s HandleErrorAttribute filter) which can then be customized to suit your application.

Figure: Bad Example – Yellow Screen of Death
Figure: Good Example - Default ASP.NET MVC custom error page

​However, as a developer you still want to be able to view the detail of the exception in your local development environment. Use the below setting in your Web Application's web.config file to view the yellow screen locally but present a nice error screen to the user.


​​​Figure: Good Example - Don't hide the yellow screen of death in the local environment

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address: