Easy Error Management
(Page 1 of 4 )

Tired of hunting down mysterious bugs which users have reported (perhaps incorrectly) within your application? Having a problem with VBScript’s
IsNumeric() function? These few tricks will serve to make your application more user-friendly, but more importantly help you prevent, locate, and fix errors even if no one reports the bug!Chances are, if you are reading this article, you plan to script or have scripted one or more ASP application(s). To follow this stating-the-obvious form of logic, it can be safely stated that you
will run into some of the very same problems that I have, which will more or less occur as follows:
[italic]You:
I have created the ultimate ASP application!!!
User: I found a bug!
You:
1. Where did you find it?
2. What was the error message?
3. What were you doing?
User:
1. I don’t know.
2. I don’t remember exactly what the message was, something like ‘type mismatch’…I think.
3. I was just (with one of the following): logging on/off; saving/generating a report; I don’t remember, etc…
You:
oh.[/italic]
This is followed by hours of you trying to mimic the actions of the user, within their permission level, performing countless actions within the application, all in hopes of finding the mysterious bug. You throw in countless lines of
“Response.Write( variable & “ - “ & TypeName( variable ) )“ to locate the offending variable.
Upon determining the cause of the error, and the cause of the cause, you realize some degree of error-checking is necessary. The following three tricks will speed up the debugging of you applications, save you many, many lines of code, and are easily reusable.
Next: First Trick: Checking for Truly Numeric Values >>
More ASP Articles
More By Justin Cook