From this https://stackoverflow.com/a/18404091/24267 I gather that
The customErrors attribute is used when the .net code is throwing an exception (404, 403, 500 etc) and the httpErrors attribute is used when IIS itself is throwing an exception.
I want QA to be able to test my 500 page. It's easy enough to throw an asp.net exception to test customErrors ("throw new Exception()" in an .aspx page), but how do I force IIS to throw an exception to test httpErrors?
Response.StatusCode
to the error value you want in that page initialization and letCustomErrors
handle that error – techspider