ASP 错误捕捉,处理

Asp利用 On Error Resume Next捕捉异常,根据Err.Number判断是否有错误

注:On Error Goto 0取消捕捉异常

模板文件页面

<%
Response.Buffer = True
'On Error Resume Next
%>
<%
If Err.Number <> 0 Then
Response.Clear
%>
<html>
<head>
<title></title>
</head>
<body bgcolor="#C0C0C0">
<font face='ARIAL'>An error occurred in the execution of this ASP page<br>
Please contact administrator.<p>
<b>Page Error Object</b><br>
Error Number:<%= Err.Number%><br>
Error Description:<%= Err.Description%><br>
Error Source:<%= Err.Source%><br>
Error Line:<%= Err.Line%><br>
</font>
</body>
</html>
<%End If %>

原文地址:https://www.cnblogs.com/TddCoding/p/4900067.html