Package org.forgerock.audit.util
Class ResourceExceptionsUtil
java.lang.Object
org.forgerock.audit.util.ResourceExceptionsUtil
Utility class to use on ResourceExceptions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceException
Adapts aThrowable
to aResourceException
.static ResourceException
notSupported
(Request request) Creates a NotSupportedException.static ResourceException
notSupportedOnCollection
(Request request) Creates a NotSupportedException.static ResourceException
notSupportedOnInstance
(Request request) Creates a NotSupportedException.
-
Method Details
-
adapt
Adapts aThrowable
to aResourceException
. If theThrowable
is an JSONJsonValueException
then an appropriateResourceException
is returned, otherwise anInternalServerErrorException
is returned.- Parameters:
t
- TheThrowable
to be converted.- Returns:
- The equivalent resource exception.
-
notSupported
Creates a NotSupportedException.- Parameters:
request
- the crest request- Returns:
- a NotSupportedException
-
notSupportedOnCollection
Creates a NotSupportedException.- Parameters:
request
- the crest request- Returns:
- a NotSupportedException
-
notSupportedOnInstance
Creates a NotSupportedException.- Parameters:
request
- the crest request- Returns:
- a NotSupportedException
-