VBScript » Err » Raise

object.Raise(number[, source, description, helpfile, helpcontext])
Receives the number associated with the user defined error that will be raised.

This method is used to generate a VBScript runtime error.

The arguments, with the exception of number, are all optional. Note that if no arguments are supplied, any error values that have not been cleared from the Err object will automatically be inherited by the new instance of the object.


On Error Resume Next
Err.Raise 8 'raise a user-defined error
Err.Description = "My Error"
Err.Source = "MyAppName"
Response.Write "An Error of the type '" Err.Description "' has been_ caused by '" Err.Source "'."
"An Error of the type 'My Error' has caused by 'MyAppName'."