Er, handling errors in an error handling routine?

Er, handling errors in an error handling routine?

Post by Mike Kingsco » Wed, 19 Feb 2003 19:42:17



Hi there,

I've created a centralised error handler (yay for me) called
HandleError that exists in a class module. The func takes in a couple
of strings and then a ByVal ErrObject (the actual VB error object) and
a couple of optional error objects (ADODBErrors collection and
XMLParse Error). I then extract all necessary data from the error
objects and chuck them into an XML document.

It all works fine and dandy, until I try to add the line 'On Error
Goto ErrHandler' in the HandleError func. Then I lose my values from
my ErrObject parameter. I guess that line of code clears the VB Error
object, which is a bit of a pain because I need the values in it. I
suppose I could extract the VB error object's values before that line,
but I'd rather not.

So, how does one do error handling inside an error handling routine?
By the way, I'd rather pass in error objects then error values, like,
don't even go there, girlfriend... <Ahem>

Thanks for any help,

Mike K.

 
 
 

Er, handling errors in an error handling routine?

Post by Randy Birc » Thu, 20 Feb 2003 11:46:39


Error handling routines can not have error trapping. On a second error (an
error in an error handler) the app terminates.

--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.


# Hi there,
#
# I've created a centralised error handler (yay for me) called
# HandleError that exists in a class module. The func takes in a couple
# of strings and then a ByVal ErrObject (the actual VB error object) and
# a couple of optional error objects (ADODBErrors collection and
# XMLParse Error). I then extract all necessary data from the error
# objects and chuck them into an XML document.
#
# It all works fine and dandy, until I try to add the line 'On Error
# Goto ErrHandler' in the HandleError func. Then I lose my values from
# my ErrObject parameter. I guess that line of code clears the VB Error
# object, which is a bit of a pain because I need the values in it. I
# suppose I could extract the VB error object's values before that line,
# but I'd rather not.
#
# So, how does one do error handling inside an error handling routine?
# By the way, I'd rather pass in error objects then error values, like,
# don't even go there, girlfriend... <Ahem>
#
# Thanks for any help,
#
# Mike K.

 
 
 

1. Need VB 3.0 Error Handling Code / Error Code Lists

I am in the process of writing a somewhat involved Visual Basic
app.  Anyway, during development, I have encountered a need for a
relatively robust error handling system and a table of error codes
in either ASCII or *.dbf or *.mdf format.  I know that this topic
has probably been encountered by someone else.  I really would
like to avoid re-inventing the wheel so to speak.  If anyone has
any information where I could get relatively robust public
domain error handling code for VB 3.0 and/or a list of the error
codes in a readable format (the *.hlp file doesn't let you print
them!), please E-Mail me at the following address:


Thank You in advance. Mark Podracky.

2. FTP site for Nat-lang source?

3. error handling for undocumented error

4. RZ55 SCSI disk in PC: termination?

5. Error Handling

6. Traffic control

7. Question about errors that might happen when handling with files.

8. OE on Network

9. MAPI error handling

10. CDO Error handling info???

11. WinSock - Handle Invalid Certificate Authority Error

12. MAPI error handling problems

13. Error 12001 when using inetopenurl in real multithreaded vb application (Handle leak)