Enable or disable error handlers.
illustrate
If the OnErrorResumeNext statement is not used in your code, the runtime error will display an error message, and the execution of the code will be terminated. However, the specific operation is determined by the host running the code. The host can sometimes selectively handle various errors. In some cases, it can activate the script debugger where the error occurs. In other cases, since the host cannot notify the user, the error that occurs is not explicitly stated. As for how to handle errors, it depends entirely on the function of the host.
In any special procedure, the error that occurs is generally not fatal as long as the error handler is enabled on the call stack. If the local error handler is not enabled in a process, when an error occurs, control can be transferred through the stack call until a process with an error handler is found and the error is handled where the error occurs. If no error handler is found during the call stack, an error message is displayed where the error occurs, while the code execution is terminated, or the error is handled correctly through the host.
OnErrorResumeNext will cause the program to continue to execute as a statement after the error statement, or as a statement in the most recent process called (which contains the OnErrorResumeNext statement). This statement can continue to execute the program regardless of runtime errors, and then you can establish an error handling routine inside the process. When another procedure is called, the OnErrorResumeNext statement becomes inactive. Therefore, if you want to perform internal error handling in a routine, you should execute the OnErrorResumeNext statement in each called routine.
When another procedure is called, the OnErrorResumeNext statement is prohibited, so if you want to embed an error handler in your routine, you need to execute the OnErrorResumeNext statement every time the routine is called. When exiting a process, the error handler can restore to its state before entering the exited process.
If you have enabled the OnErrorResumeNext error handler, you can use OnErrorGoTo0 to disable the error handler.
<%
Iferr.Number<>0Then
Response.Write"Number="&err.Number&"<p>"
Response.Write"Description="&err.Description&"<p>"
Response.Write"Source="&err.Source
err.Clear
%>