lunes, 14 de mayo de 2007

manejo de errores en asp

Para manejar errores en asp primero se debe de poner la siguiente linea
<%
On Error resume Next
%>
Esto nos permite que la pagina se muestre a pesar de los errores ahora para poder ver el detalle de los mismos tenemos el siguiente codigo
<%
If Err.Number <> 0 then
HandleError Err.Description
Error.Clear
End If
%>
<%
Sub HandleError
‘ Send email notifying the webmaster of the site about the error
‘ Write the error message in a application error log file
‘ Display friendly error message to the user
‘ Stop the execution of the ASP page
End Sub
%>