Wrap objects to enable unchecked exceptions to be caught and handled.
For each method, exceptions are handled as follows:
- Checked exceptions are left alone and propogate upwards in the
obvious way, since they are an expected aspect of the method's
specification.
- Unchecked exceptions which have already been caught and wrapped in
ClientCodeException are left alone to continue propogating upwards.
- All other unchecked exceptions (i.e. subtypes of RuntimeException
and Error) and caught, and rethrown as a ClientCodeException with
its cause set to the original exception.
The intent is that ClientCodeException can be caught at an appropriate point
in the program and can be distinguished from any unanticipated unchecked
exceptions arising in the main body of the code (i.e. bugs.) When the
ClientCodeException has been caught, either a suitable message can be
generated, or if appropriate, the original cause can be rethrown.
This is NOT part of any supported API.
If you write code that depends on this, you do so at your own risk.
This code and its internal interfaces are subject to change or
deletion without notice.