Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Line Number For ASP Error

Status
Not open for further replies.

lbarron

Technical User
Jan 22, 2002
92
GB
Hi,

I want to modify my error trapping routine to show the line number in the ASP page where the error occurred.

Can this be done?

Cheers

Lee
 
here are a few values you can access...
Code:
Set objASPError = Server.GetLastError()

If objASPError.File <> "" Then
  Response.Write objASPError.File & "<BR>" & vbcrlf
  Response.Write objASPError.ASPCode & "<BR>" & vbcrlf
  Response.Write objASPError.Category & "<BR>" & vbcrlf
  Response.Write objASPError.Line & "<BR>" & vbcrlf
  Response.Write objASPError.Column & "<BR>" & vbcrlf
  Response.Write objASPError.Description & "<BR>" & vbcrlf
  Response.Write objASPError.ASPDescription & "<BR>" & vbcrlf
End If

Set objASPError = Nothing

Tony
________________________________________________________________________________
 
also if you're not seeing the line numbers in the errors, under broswer options for your browser, disable friendly error messages.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
On uncaught errors, line numbers are indeed sent by default, as DreX noted. That simple change in IE will make catching uncaught errors MUCH easier.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top