Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Excerpt
hiddentrue

We should define the SlingException as a RuntimeException and use it as the base class for all exceptions defined in the Sling API. (IMPLEMENTED)

Status: DRAFTIMPLEMENTED
Created: 23. December 2007
Author: fmeschbe

...

  1. The SlingException is a RuntimeException and is used as the base exception for all exceptions defined by the Sling API.
  2. The HttpStatusCodeException is now an extension of the SlingException. This way, this exception may not be inadvertedly caught and thus swallowed when catching IOExceptionremoved. Status codes are better reported back to the client using HttpServletResponse.sendError().
  3. Add ResourceNotFoundException which may be used by scripts and servlets to report a missing resource.
  4. Add QuerySyntaxException thrown from the ReourceResolver.findResources and ResourceResolver.queryResources methods.
  5. Add ScriptEvaluationException thrown by SlingScript.eval wrapping and further failure cause.
  6. Drop ServiceNotAvailableException and the respective ServiceLocator.getRequiredService: The method and thus the exception are probably not very usefull. Rather the ServiceLocator.getService method should be used and the result checked for null.
  7. Add SlingIOException and SlingServletException both extending SlingException. These exceptions are used to wrap IOException and ServletException 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_exceptionsImage Removed