Package org.forgerock.audit.util
Class ResourceExceptionsUtil
- java.lang.Object
-
- org.forgerock.audit.util.ResourceExceptionsUtil
-
public final class ResourceExceptionsUtil extends Object
Utility class to use on ResourceExceptions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ResourceException
adapt(Throwable t)
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 Detail
-
adapt
public static ResourceException adapt(Throwable t)
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
public static ResourceException notSupported(Request request)
Creates a NotSupportedException.- Parameters:
request
- the crest request- Returns:
- a NotSupportedException
-
notSupportedOnCollection
public static ResourceException notSupportedOnCollection(Request request)
Creates a NotSupportedException.- Parameters:
request
- the crest request- Returns:
- a NotSupportedException
-
notSupportedOnInstance
public static ResourceException notSupportedOnInstance(Request request)
Creates a NotSupportedException.- Parameters:
request
- the crest request- Returns:
- a NotSupportedException
-
-