What I am trying to do is throw a custom exception that I have created from a api method that I am implementing. For example, 'startElement' method throws SAXException, but I want to throw my own exception, how do I do this?
You don't. You throw a SAXException or you don't throw anything.
If I understand you right, and you are writing an implementation of a method which throws SAXException, and the code in that method desperately wants to throw some other exception, then what it should do is throw a SAXException which wraps that other exception. Check the API documentation for SAXException and search for the text "wrap" to see how to create such an exception.
Joined: Nov 10, 2008
Thanks Paul, that's what I was doing with the subclass SAXParseException and thought there might be a better practice. Thanks again.
subject: Exception handling: throw custom exception while using apis