Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added comment about removing HttpStatusCodeException and adding ResourceNotFoundException

...

  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.

...