Pages

Thursday, July 5, 2012

Err Objects Asp (Vbscript)

Error objects 
There are 2 error objects that you can use to handle the errors that occur while creating and executing ASP Code.
  • Err Object
  • ASPError Object 
The err object contains information about runtime errors. It is built in object provided with ASP 2.0 and works with ASP 3.0  You can use the properties of the Err object ot check for errors. For example to raise an error, you need to use the Err.Raise method with appropriate paramaters.


AspError Object

Asp 3.0 is installed with the web server iis 5.0. The ASPError object is an in built object that is used for error handling in ASP. When the IIS Web server encounters a compilation or runtime error, it caused a 500;100 custom error. The default behavior of IIS is to transfer control to 500;100. In this process, iis also creates an instance of the ASPError Object.

Properties of Err Objects

Properties        used to 
Description  Return a short description of an eror that comes
HelpFile  Return the path to Help file that contain error information
Number  Return numeric errror code. It is the default property of the err object
Source Return the name of the object or application that caused the error

Properties of ASPError object


Property  Description
Aspcode Contains error code caused by IIS
Number contains standard COM error code
Source contains the source code fo the line that caused the error
Category There can be 3 source Internal, scritpingerror or object erro
File contains name of file that caused the error
Line Line number of the code that causde error
Column contains the column position of the code that caused the error
Description contains a short description of error
ASPDescription contains a detailed description of the error

No comments:

Post a Comment