Package org.apache.sling.api.resource
Class ResourceNotFoundException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.apache.sling.api.SlingException
-
- org.apache.sling.api.resource.ResourceNotFoundException
-
- All Implemented Interfaces:
Serializable
public class ResourceNotFoundException extends SlingException
An Exception that causes Sling to return a 404 (NOT FOUND) status code. This exception should not be caught but rather let be handed up the call stack up to the Sling error and exception handling.The advantage of using this exception over the
HttpServletResponse.sendError
methods is that the request can be aborted immediately all the way up in the call stack and that in addition to the status code and an optional message aThrowable
may be supplied providing more information.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResourceNotFoundException(String message)
ResourceNotFoundException(String resource, String message)
ResourceNotFoundException(String resource, String message, Throwable cause)
ResourceNotFoundException(String message, Throwable cause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getResource()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-