To avoid disclosing database error information use
"try…catch" block where possible and provide a user friendly error
message rather than showing system information. Also by configuring IIS, we can
set a general error page. This way no one will get the actual database
information. The way of creating custom error page for ASP application can be
found here. In the error
page, we can implement an automatic error reporting system which will trigger
an email to the programmer with a detailed error report while the error will
occur. A sample can be found in the source code.