...
Excerpt | ||
---|---|---|
| ||
We should define the |
Status: DRAFTIMPLEMENTED
Created: 23. December 2007
Author: fmeschbe
...
- The
SlingException
is aRuntimeException
and is used as the base exception for all exceptions defined by the Sling API. - The
HttpStatusCodeException
is now an extension of theSlingException
. This way, this exception may not be inadvertedly caught and thus swallowed when catchingIOException
removed. Status codes are better reported back to the client usingHttpServletResponse.sendError()
. - Add
ResourceNotFoundException
which may be used by scripts and servlets to report a missing resource. - Add
QuerySyntaxException
thrown from theReourceResolver.findResources
andResourceResolver.queryResources
methods. - Add
ScriptEvaluationException
thrown bySlingScript.eval
wrapping and further failure cause. - Drop
ServiceNotAvailableException
and the respectiveServiceLocator.getRequiredService
: The method and thus the exception are probably not very usefull. Rather theServiceLocator.getService
method should be used and the result checked fornull
. - Add
SlingIOException
andSlingServletException
both extendingSlingException
. These exceptions are used to wrapIOException
andServletException
instances to be able to forward them as runtime exceptions to the appropriate error handling.
This change also has an influence on the implementation of the Sling API:
...
The proposed API changes can be evaluated in the Sling whiteboard at http://svn.apache.org/repos/asf/incubator/sling/whiteboard/fmeschbe/effective_exceptions