Turning off ‘An error occurred on the server … ’

The full error message actually reads:

An error occurred on the server when processing the URL. Please contact the system administrator

I recently needed a more descriptive error message when debugging a script, and had too much trouble finding the answer I needed. The good news is, if you are reading this, I will tell you how to easily disable the default error message so that IIS will display a much more appropriate error message.

Before I go on, I do want to let you know that this setting should only be set when debugging a script. There are security risks with showing the exact error message to a [malicious] visitor.

  • Open IIS
  • Expand the local computer directory
  • Expand the ‘Web Sites’ directory
  • Right-click the website you are interested in showing detailed errors, select ‘Properties’.
  • Select the ‘Home Directory’ tab across the top
  • Select the ‘Configuration…’ button in the lower-right
  • Select the ‘Debugging’ tab across the top [far right]
  • Under ‘Error messages for script errors’, make sure you have the first radio button selected; ‘Send detailed ASP error messages to client’.

And there you have it. Go back to your browser and hit refresh. Presto!

Nick