Java Reference
In-Depth Information
Itisnotuncommonforaclass'spublicmethodstocallhelpermethodsthatthrowvari-
ousexceptions.Apublicmethodwillprobablynotdocumentexceptionsthrownfroma
helpermethodbecausetheyareimplementationdetailsthatoftenshouldnotbevisible
to the public method's caller.
However,becausethisexceptionmightbehelpfulindiagnosingtheproblem,thepub-
lic method can wrap the lower-level exception in a higher-level exception that is doc-
umented in the public method's contract interface. The wrapped exception is known
as a cause because its existence causes the higher-level exception to be thrown. A
Search WWH ::




Custom Search