What is the direct cause and source of the "Sorry, an error occurred while processing your request." message?

20,977

The default error handling of an out-of-box ASP.Net MVC Application redirects errors to the Error.aspx shared view. You will find the "Sorry, an error occurred while processing your request" message text inside the Error.aspx file. The message is not generated from a .Net class.

The following SO question brought me to the light: ASP.NET MVC HandleError not working (customErrors is set to "On")

To see more details about the underlying error you have a few options.

  • Customize the default Error.aspx page to display details about the underlying error.

  • Turn off the CustomErrors in the web.config file. Future errors should display the default ASP.Net "yellow screen" error details instead of the "Sorry, an error occurred message".

  • Handle the error specifically in the associated ActionResult method.

Share:
20,977
Rich C
Author by

Rich C

Updated on July 23, 2022

Comments