I got a WriteLimitReachedException because my file was too big.  The message 
tells me that the text up the limit is still available.  However, it's tricky 
to get that text and at the same time, respond appropriately to SAXExceptions.  
Originally, my method was catching SAXEXceptions and assumed there was an error.
What I really want to do it to be able to catch WriteLimitReachedException, but 
still throw other SAXException, which would indicate that something else went 
wrong.  But since WriteLimitReachedException is private, I can't do that.

Here's what my code originally looked like:
[public void myMethod throws SAXException {               ? Assume that 
SAXException is a fatal error and just throw it       parser.parse(...)     }   
  // Display or otherwise process my data obtained by the handler  }]
But this didn't work, because if I get a WriteLimitReachedException, it doesn't 
tell me what data that it got


Given this new knowledge, here's what I want to do:

[public void myMethod throws SAXException {    try {       parser.parse(...)    
 } catch (WriteLimitReachedException e) {           // Ignore or report the 
error, but still proceed with the data that was obtained            // Any 
other SAXException will be thrown      }       // Display or otherwise process 
my data obtained by the handler  }]

Attachment: image002.emz
Description: image002.emz

Reply via email to