It seems i came late to the party, but you should better check this out too.
So in system.web
for caching up exceptions within the application such as return HttpNotFound()
<system.web>
<customErrors mode="RemoteOnly">
<error statusCode="404" redirect="/page-not-found" />
<error statusCode="500" redirect="/internal-server-error" />
</customErrors>
</system.web>
and in system.webServer
for catching up errors that were caught by IIS and did not made their way to the asp.net framework
<system.webServer>
<httpErrors errorMode="DetailedLocalOnly">
<remove statusCode="404"/>
<error statusCode="404" path="/page-not-found" responseMode="Redirect"/>
<remove statusCode="500"/>
<error statusCode="500" path="/internal-server-error" responseMode="Redirect"/>
</system.webServer>
In the last one if you worry about the client response then change the responseMode="Redirect"
to responseMode="File"
and serve a static html file, since this one will display a friendly page with an 200 response code.