Share via


On Error Resume Next

The On Error Resume Next error handler is a Visual Basic Scripting Edition statement that allows a page to continue processing even after it has encountered an error. The ability to continue processing script after encountering an error is useful if errors are expected, or if you wish to implement custom error handling. The dangerous part of enabling the On Error Resume Next statement is that it turns off all error handling for subsequent statements in the function until the On Error Goto 0 statement is called.

The On Error Resume Next statement is used in the Solution Sites to ignore specific non-critical errors. These errors are usually generated by objects that may return an error, but the error is expected and can be handled. Careful attention must be paid to re-raise any non-expected error that occurred during the On Error Resume Next code block. You can raise an error using the Err.Raise property, but this statement must be outside the On Error Resume Next code block.

The Solution Sites use the On Error Resume Next statement as little as possible, mitigating the risk of accidentally leaving it on. Centralized error processing is left to the 500error.asp page.

When the Solution Sites use the On Error Resume Next statement, the affected section of code is typically indented for clarity.

See Also

Normal Bubble-Up

Pipeline Warnings

ASP Error Pages for Solution Sites

Development and Production Modes for Solution Sites

Copyright © 2005 Microsoft Corporation.
All rights reserved.