Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Error Handling

Reply
Thread Tools

Error Handling

 
 
John .
Guest
Posts: n/a
 
      10-28-2005
I have an error handling routine that emails me the Err.Source, Err.Nbr,
and Err.Description in the event of an error. How can I include the
line number of the error as well and the filename?



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      10-28-2005
How about something like this:

?????????????????????????????????????????????????? ????>?????????????????????????????????????>??????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????>???????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ????????????????????????????????>????????????????? ????..??????????????????.????????????????????????? ?????????????????????????????????????????????????? ????????????????????????????????????????????????>? ????????????????????....????????????

Ray at work

"John ." <(E-Mail Removed)> wrote in message
news:eYLYeK%(E-Mail Removed)...
>I have an error handling routine that emails me the Err.Source, Err.Nbr,
> and Err.Description in the event of an error. How can I include the
> line number of the error as well and the filename?
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      10-28-2005
Or try this understable reply. This particular code is meant for
displaying error data in a custom error page, but it'll give you info on
getting error information.


Dim aErrorInfo(1,13)
Dim oError
Set oError = Server.GetLastError

aErrorInfo(0,0) = "ASP Code" : aErrorInfo(1,0) = oError.ASPCode
aErrorInfo(0,1) = "ASP Description" : aErrorInfo(1,1) =
oError.ASPDescription
aErrorInfo(0,2) = "Description" : aErrorInfo(1,2) = oError.Description
aErrorInfo(0,3) = "Category" : aErrorInfo(1,3) = oError.Category
aErrorInfo(0,4) = "Number" : aErrorInfo(1,4) = oError.Number
aErrorInfo(0,5) = "Source" : aErrorInfo(1,5) = oError.Source
aErrorInfo(0,6) = "File" : aErrorInfo(1,6) = oError.File
aErrorInfo(0,7) = "Line" : aErrorInfo(1,7) = oError.Line
aErrorInfo(0, = "Querystring" : aErrorInfo(1, = Request.Querystring
On Error Resume Next
aErrorInfo(0,9) = "Form Data" : aErrorInfo(1,9) = Request.Form
If Err.Number <> 0 Then aErrorInfo(0,9) = "(binary data)"
On Error Goto 0
aErrorInfo(0,10) = "All HTTP" : aErrorInfo(1,10) = "<textarea
style=""width: 410px; height=100px; font: 8pt verdana;"">" &
Request.ServerVariables("ALL_HTTP") & "</textarea>"
aErrorInfo(0,11) = "Remote Address" : aErrorInfo(1,11) =
Request.ServerVariables("REMOTE_ADDR")
aErrorInfo(0,12) = "Description" : aErrorInfo(1,12) =
Request.ServerVariables("REMOTE_HOST")
aErrorInfo(0,13) = "Request Date" : aErrorInfo(1,13) = FormatDateTime(Now,
1) & " " & FormatDateTime(Now, 3)

Ray at work


"John ." <(E-Mail Removed)> wrote in message
news:eYLYeK%(E-Mail Removed)...
>I have an error handling routine that emails me the Err.Source, Err.Nbr,
> and Err.Description in the event of an error. How can I include the
> line number of the error as well and the filename?
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
John .
Guest
Posts: n/a
 
      10-28-2005
thanks costanza. i'll try that. i'm sure that will do the trick.



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      10-28-2005
No problem Jonn.

Ray at work

"John ." <(E-Mail Removed)> wrote in message
news:ule5lV%(E-Mail Removed)...
> thanks costanza. i'll try that. i'm sure that will do the trick.
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
John .
Guest
Posts: n/a
 
      10-28-2005

does this work for error codes below 100? i.e. type mismatches (13).

also, can the object be used as a parameter in a subroutine?


*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
McKirahan
Guest
Posts: n/a
 
      10-28-2005
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:OHWKkR#(E-Mail Removed)...
> Or try this understable reply. This particular code is meant for
> displaying error data in a custom error page, but it'll give you info on
> getting error information.


[snip]

> "John ." <(E-Mail Removed)> wrote in message
> news:eYLYeK%(E-Mail Removed)...
> >I have an error handling routine that emails me the Err.Source, Err.Nbr,
> > and Err.Description in the event of an error. How can I include the
> > line number of the error as well and the filename?


http://www.devguru.com/Technologies/...lasterror.html

"By default, the error information is sent to the
"\iishelp\common\500-100.asp" file."

Also, "Category" is another one.


 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      10-28-2005
Give it a try and see! http://www.aspfaq.com/5007

Ray at work

"John ." <(E-Mail Removed)> wrote in message
news:%23ns5eI$(E-Mail Removed)...
>
> does this work for error codes below 100? i.e. type mismatches (13).
>
> also, can the object be used as a parameter in a subroutine?
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
John .
Guest
Posts: n/a
 
      10-29-2005
I did and it didn't seem to do anything. I tried without passing as an
object and it didn't return any info about the error. Is the
GetLastError available in IIS 6.0 too?



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      10-31-2005
http://www.aspfaq.com/5007

Yes. Show your code.

http://www.aspfaq.com/5007

Ray at work

"John ." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I did and it didn't seem to do anything. I tried without passing as an
> object and it didn't return any info about the error. Is the
> GetLastError available in IIS 6.0 too?
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
signal handling and (structured) exception handling Peter C++ 34 10-17-2009 10:03 AM
python list handling and Lisp list handling Mark Tarver Python 22 04-26-2009 09:36 PM
Is faster handling hexadecimal values than handling chars? IƱaki Baz Castillo Ruby 1 04-15-2008 09:04 AM
Global Error handling in Applicatio_Error() of Global.asax VSK ASP .Net 1 07-29-2003 03:12 AM
Error Handling Kenneth Keeley ASP .Net 0 07-01-2003 03:45 AM



Advertisments