In my VB6 application I have procedural error handling across the programme, in (almost every procedure) .I'm also using linenumbers throughout the programme so as to catch the error occuring on which line. The error handling has been working great and raising errors in each procedure as they occur and the error handler pops up a box that displays the name of the procedure and the error number. (i'm using the VBDocumentor add-in)>
HOWEVER, I have a user who is experiencing a bug that I cannot reproduce, and the error screenshot she sends me shows the bug occuring on a line of code that calls a subprocedure. INSTEAD of the line of code in the subprocedure where the error is occuring!?
So to restate simpley;
SubA calls SubB , SubB calls other subs (SubC).
The error gets triggered in SubA , on the line calling SubB.
---------------------
For example:
Private sub SubA()
on error goto errhandle
'do code
call SubB ' ---> *** users error occurs on this line. but not in Lesser sub procedures.. WHY?
errhandle:
call Globalerrhanlder blah, blah, blah
End Sub
--------------
My question is why doesnt the error trap show the actual line of error in the sub procedure rather than the parent procedure? It's like the sub procedure isnt handling the error, but I know it is handling errors because I tested that by supplying an error coded into program and it flagged it in the sub procedure.
The sub procedure (SUBB) also calls other procedures, I've checked through them and they also contain their own relevant erorr handling (by sending it to global error handler). If the error did occur in one of these "SUB SUB procedures" then if it couldnt handle the error woudlnt it push it back up the previous Sub procedure.
Start Free Trial