Print Page | Close Window

Error Notification

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=20970
Printed Date: 29 March 2026 at 8:42am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Error Notification
Posted By: VBScript
Subject: Error Notification
Date Posted: 09 August 2006 at 5:02pm
I am working on an ASP page which is executed but another ASP page that sends post data to it.

So for this reason. I cannot actually see the pages response or any error messages.

Is it possible to get an Error Message into a variable? I need something that will capture an error message where ever it occurrs in the page?

Is this possible?


-------------
http://www.james-r.co.uk" rel="no follow - James
http://www.gotrillian.com/?4498-20" rel="no follow - Trillian - M



Replies:
Posted By: dfrancis
Date Posted: 09 August 2006 at 6:28pm
Is it a server error or a script error? Do you know? I spent a good amount of time writing my own error traps and it is possible.
 
If Request("FormField") = "" Then
MyError = "Form value empty"
End If
 
If it is processing through an auto subit then try something like
 
If Request("FormField") = "" Then
Response.Write("<input type=hidden name=myerror value=""form value empty"">")
End if
 
I have a couple other ideas but the server I use for a playground appears to be offline t the moment. In other words, I have more urgent needs at the moment.
 
Hope that helps. (Off the top of my flat head)
 
 


Posted By: VBScript
Date Posted: 09 August 2006 at 7:07pm
Just any ASP generated erorr.

Like If I Had

"If VarA = VarB The" When It should be "If VarA = VarB Then"

i want the error message to be put into a variable which can then be logged.


-------------
http://www.james-r.co.uk" rel="no follow - James
http://www.gotrillian.com/?4498-20" rel="no follow - Trillian - M


Posted By: dfrancis
Date Posted: 09 August 2006 at 8:08pm
You'll like have to write your own else if's for each then. I went through this with a large data set I was processing and there is no easy way that I know of.
 
The easiest way is to do a response write of each of your vars to see what they are sending unless you need an ongoing log of errors after you publish the app.
 
Just my 2 cents.
 
Good luck


Posted By: dpyers
Date Posted: 10 August 2006 at 12:38am
One way to do it is by instructing asp at the beginning of a script to ignore errors and then check for an error code at the end of the script and print the error.

In the beginning of the code you want to check, put..
On Error Resume Next

At the end of the code you want to check, put...

If Err <> 0 Then
   Response.Write Err & " - " & Err.Description
End If


EDIT: This will id your errors from the bottom up.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: VBScript
Date Posted: 10 August 2006 at 7:48am
Thank you very much Dpyers

-------------
http://www.james-r.co.uk" rel="no follow - James
http://www.gotrillian.com/?4498-20" rel="no follow - Trillian - M



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net