I have error handling built inot my application, and it returns a user-defined error, number 4000.
It seems because my code has error handling I don’t get any information. Is there a way to find out more about the error without disabling error handling?
Subject: OpenLog. Learn it, love it, live it.
-
Download OpenLog, sign it, put it on your server. OpenNTF.org - The Open Source Community for Collaboration Solutions
-
In each piece of main code (i.e. Initialize in your agents, or Click in your action buttons), in the error handling, either put “Call LogError()” or “Messagebox LogError()” If you don’t have error handling, start your code with “On Error Goto LogError” and end it with
ExitSub:
Exit Sub
LogError:
Messagebox LogError()
Resume ExitSub
- For each subroutine, start with
On Error Goto StackError
and end with
Exit Function (or sub)
StackError:
Call AddToStackTrace()
You now have error trapping that logs the time, user, client version, line number, error number, error message, function, calling function, calling function’s calling function… yadda yadda.
Or… for quick debugging, I declare a global constant like
Const gcbErrorHandling = True 'Turn to false to disable error handling
and then prefix all my On Error statements with
"If gcbErrorHandling Then "
This way, I can turn on the debugger, run my code, and have it stop dead right where the error occurs.