Enum Class V2ErrorCode

java.lang.Object
java.lang.Enum<V2ErrorCode>
org.codelibs.fess.api.v2.V2ErrorCode
All Implemented Interfaces:
Serializable, Comparable<V2ErrorCode>, Constable

public enum V2ErrorCode extends Enum<V2ErrorCode>
Canonical error codes for the /api/v2 response envelope.

Each constant carries a stable wire code (snake_case string) and a default HTTP status. The wire code is what API consumers branch on; the HTTP status is a sensible default that individual handlers may override before writing the envelope if a more specific code is appropriate.

  • Enum Constant Details

    • INVALID_REQUEST

      public static final V2ErrorCode INVALID_REQUEST
      Malformed or otherwise unprocessable request.
    • AUTH_REQUIRED

      public static final V2ErrorCode AUTH_REQUIRED
      The endpoint requires authentication and none was supplied.
    • FORBIDDEN

      public static final V2ErrorCode FORBIDDEN
      The caller is authenticated but not permitted to perform the action.
    • NOT_FOUND

      public static final V2ErrorCode NOT_FOUND
      The requested resource or endpoint does not exist.
    • CONFLICT

      public static final V2ErrorCode CONFLICT
      The request conflicts with the current state of the resource (e.g., duplicate-key insert).
    • METHOD_NOT_ALLOWED

      public static final V2ErrorCode METHOD_NOT_ALLOWED
      The HTTP method is not supported for this endpoint.
    • RATE_LIMITED

      public static final V2ErrorCode RATE_LIMITED
      The caller has exceeded a rate or quota threshold.
    • UNSUPPORTED_MEDIA_TYPE

      public static final V2ErrorCode UNSUPPORTED_MEDIA_TYPE
      The request's Content-Type is not supported (e.g., not application/json).
    • PAYLOAD_TOO_LARGE

      public static final V2ErrorCode PAYLOAD_TOO_LARGE
      The request body exceeds the server's size limit.
    • SERVICE_UNAVAILABLE

      public static final V2ErrorCode SERVICE_UNAVAILABLE
      The server is temporarily unavailable (e.g., cluster health is red).
    • NOT_ACCEPTABLE

      public static final V2ErrorCode NOT_ACCEPTABLE
      The requested response format is not available (e.g., unsupported Accept media type).
    • INTERNAL_ERROR

      public static final V2ErrorCode INTERNAL_ERROR
      Unhandled server-side failure.
  • Method Details

    • values

      public static V2ErrorCode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static V2ErrorCode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • code

      public String code()
      Returns the stable wire code emitted in the error.code field of the v2 envelope.
      Returns:
      the snake_case wire code
    • defaultHttpStatus

      public int defaultHttpStatus()
      Returns the default HTTP status code associated with this error.
      Returns:
      the default HTTP status code