File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Joined: Feb 12, 2010
Jun 09, 2010 08:30:08
Can someone tell me why do we use exception chaining, any practical example for the same ?
Joined: Sep 29, 2008
Jun 09, 2010 09:23:55
To keep the original exception.
throw new Exception(oldException)
Did you try searching for "exception chaining"?
Joined: Oct 13, 2005
Jun 09, 2010 09:24:06
See if you can find a copy of
Thinking in Java
by Bruce Eckel; as far as I can remember he gives good examples. His opinion about Exceptions in the 3rd edition is completely different from the 4th edition, however
Joined: Jul 29, 2008
Jun 09, 2010 09:29:30
The first two Google search results for "Exception Chaining" would give you a better explanation with some practical examples.
Author of ExamLab
- a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like?
How to Ask a Question
Joined: Jun 08, 2010
Jun 10, 2010 01:47:29
it is about how an exception is related to another ...
let us say ... you get an exception say
which happened due to some sql related confusion but in actual it is a I/O Exception ...
so the two exceptions are chained together ...
take a look at the complete reference ... although it is not enough but might help you understand some.
I agree. Here's the link:
subject: exception chaining
NX: concerning exception handling
cushioning exception from bottom up...
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014