Avoid checked exceptions. Runtime exceptions are perfectly useful for this sort of thing. Declaring them in the method signature as well as documenting in the Javadocs ensures that the caller can decide whether to handle the exception or let it bubble up. If the caller chooses the latter, there’s no longer a need to explicitly catch the exception, so it’s one less place botch it up. Wrap exceptions. Wrapping exceptions is fine if you are absolutely sure that by the time a stack trace is printed, the underlying cause is shown. This is important since by the time such an exception is thrown,
...more