IOException
I'm having an IOException thrown... how can I determine which subclass it relates to, without having to catch all of the subclasses?
[140 byte] By [
javaroba] at [2007-11-26 13:56:22]

Yes, but do I need to handle all of the subclass exceptions?It's against this:socket.connect(new InetSocketAddress(dest_ip_addr, port), 10000);
> Yes, but do I need to handle all of the subclass> exceptions?No, just handle the ones you want to handle a different way first. Then catch IOException and do handle the rest.
And if there's only one particular class that you care about handling specially, and the others can be catchalled, then you can code that like this:try {
// whatever code
} catch(FileNotFoundException fnfe) {
// handle it
} catch(IOException ioe) {
// handle the rest
}
You have to code the catch clauses in that order, the more specialized classes first.