This site has been taken over by the staff of www.ASPDeveloper.Net

Please report errors to suggest@aspdeveloper.net

BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
Microsoft ASP
Base64 for VB and ASP
ASP to OLEDB
Re: How to pass values into an XSLT stylesheet from ASP
How to pass values into an XSLT stylesheet from ASP
ASP Create Yearly XML Calendar
XML Strengths & Weakness’ with DOM, ASP & XSL
FAQ - My ASP MSXML transformation always outputs UTF-16?
WAP with ASP - starting the WAP adventure
ASP/XML Guest Book
Include an ASP-file in XSL (JITIC Solution)
Read/write data with VB using ASP pages
<< LAMP
 

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :2101

 

The ASPError Object

Introduction

The ASPError object is used to display a detailed description about the error that has occurred on the asp page. This object is very useful when you work with asp pages. It calls internally the Server.GetLastError to retrieve the error information. It has several useful properties, which can be used to get detailed information i.e.: the line property can be used to retrieve the line in which the error occurred. Another one is the ASPDescription property, which returns a detailed description of the error. Below you will find a table with all available properties.

NOTE: The ASPError object as well as the GetLastError function can be only called within a 500-error handler page not from any asp page. The best is to create a custom 500-handler page, which includes the required properties. Once you have created your page, you have to change the path for the 500-error handler in IIS. Open IIS and go to the properties of your website. Now press here the Custom Errors tab and scroll down to the 500;100 HTTP Error.

Now press the “Edit Properties” button and change the URL so that it looks for your Custom Error page.

Example of a custom error page (custom500.asp)

<%

            Dim objASPError

            Set objASPError = Server.GetLastError

            Response.Write("ASPCode = " & objASPError.ASPCode)

            Response.Write("ASPDescription = " & objASPError.ASPDescription)

            Response.Write("Category = " & objASPError.Category)

            Response.Write("Column = " & objASPError.Column)

            Response.Write("Description = " & objASPError.Description)

            Response.Write("File = " & objASPError.File)

            Response.Write("Line = " & objASPError.Line)

            Response.Write("Number = " & objASPError.Number)

            Response.Write("Source = " & objASPError.Source)

%>

Example of a simple asp page to generate an error

<%

            dim myvar

            myvar = 1/0     

%>

Output

Properties

Name:

Description:

ASPCode

This property can be used to return the ASP code generated by IIS.

ASPDescription

This property can be used to retrieve a detailed error description.

Category

This property can be used to determine whether the error came from. It can either generated by ASP, by a scripting language or by an invalid object.

Column

This property can be used to determine the column position of the error.

Description

This property returns a short description of the error. Use the ASPDescription property to retrieve a detailed error.

File

This property is used to get the filename of the asp file, which generated the error.

Line

This property is used to retrieve the line where the error occurred.

Number

This property returns the COM error code.

Source

This property returns the source code from the line where the error occurred.


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Software Specialist, Linux - Finlan
Linux Core Technical Project Manage
Graphics designer at Tanzania. Expe
Integration Specialist Needed - Wor
Virtualization Server Infrastructur

View all Jobs (Add yours)
View all CV (Add yours)






    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP