Hello all, after a long time
Is this a good approach doing like this?
Say suppose while doing a read or write on database file, there are chances of either getting a IOException or EOFException. If either of exceptions are thrown, then I want to inform client/server accordingly that
database write operation is faield and the client/server should stop immediately not to corrupt any data.
So my question is, if either exception occurs am doing the same thing and also if a generic exception "Exception" occurs will do the same thing. Is there any need to catch all three individually and throw the same exception back to client? Or is it advisable to just keep "Exception" catching there?
The main reason for catching "Exception" is that if a NullPointerException occurs then also client/server is informed. Or should I just catch only those exceptions that ARE ACTUALLY thrown in try statement?
Please comment on the approach. Thanks.
[ April 22, 2004: Message edited by: Satish Avadhanam ]