Class ResourceExceptionsUtil

java.lang.Object
org.forgerock.audit.util.ResourceExceptionsUtil

public final class ResourceExceptionsUtil extends Object
Utility class to use on ResourceExceptions.
  • Method Details

    • adapt

      public static ResourceException adapt(Throwable t)
      Adapts a Throwable to a ResourceException. If the Throwable is an JSON JsonValueException then an appropriate ResourceException is returned, otherwise an InternalServerErrorException is returned.
      Parameters:
      t - The Throwable 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