You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Brent L Johnson <br...@bjohnson.net> on 2000/12/13 16:06:50 UTC

Error Handling

This may be a stupid question - but, is there a way to access some existing object (a List for example) in the error handling methods (warning, error, and fatalError).  Right now - to process the validation error, I'm throwing an exception and including the validation error message as the message for the thrown exception.  I'm then catching that by putting a try/catch around the parse() method.

Throwing an exception there is just not enough information.  Anyone have any ideas?

Thanks,

- Brent

Re: Error Handling

Posted by Brent L Johnson <br...@bjohnson.net>.
Actually - I managed to poke around until I figured it out.  Turns instead of using a separate class for the validation handling, I just included the methods in the object that calls the parse()... then I could simply access the existing List in the object when the validation methods were called (in case anyone was interested).

- Brent
  ----- Original Message ----- 
  From: Brent L Johnson 
  To: Xerces List 
  Sent: Wednesday, December 13, 2000 10:06 AM
  Subject: Error Handling


  This may be a stupid question - but, is there a way to access some existing object (a List for example) in the error handling methods (warning, error, and fatalError).  Right now - to process the validation error, I'm throwing an exception and including the validation error message as the message for the thrown exception.  I'm then catching that by putting a try/catch around the parse() method.

  Throwing an exception there is just not enough information.  Anyone have any ideas?

  Thanks,

  - Brent

Re: Error Handling

Posted by Luke Blanshard <lu...@quiq.com>.
Brent L Johnson wrote:

> Throwing an exception there is just not enough information.  Anyone
> have any ideas?

You can define your own exception class, and add fields to hold whatever
extra information you need to pass.  Or did I misunderstand your
problem?

Luke