This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
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