Package org.codelibs.fess.api.v2
Enum Class V2ErrorCode
- All Implemented Interfaces:
Serializable,Comparable<V2ErrorCode>,Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe endpoint requires authentication and none was supplied.The request conflicts with the current state of the resource (e.g., duplicate-key insert).The caller is authenticated but not permitted to perform the action.Unhandled server-side failure.Malformed or otherwise unprocessable request.The HTTP method is not supported for this endpoint.The requested response format is not available (e.g., unsupportedAcceptmedia type).The requested resource or endpoint does not exist.The request body exceeds the server's size limit.The caller has exceeded a rate or quota threshold.The server is temporarily unavailable (e.g., cluster health is red).The request'sContent-Typeis not supported (e.g., notapplication/json). -
Method Summary
Modifier and TypeMethodDescriptioncode()Returns the stable wire code emitted in theerror.codefield of the v2 envelope.intReturns the default HTTP status code associated with this error.static V2ErrorCodeReturns the enum constant of this class with the specified name.static V2ErrorCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INVALID_REQUEST
Malformed or otherwise unprocessable request. -
AUTH_REQUIRED
The endpoint requires authentication and none was supplied. -
FORBIDDEN
The caller is authenticated but not permitted to perform the action. -
NOT_FOUND
The requested resource or endpoint does not exist. -
CONFLICT
The request conflicts with the current state of the resource (e.g., duplicate-key insert). -
METHOD_NOT_ALLOWED
The HTTP method is not supported for this endpoint. -
RATE_LIMITED
The caller has exceeded a rate or quota threshold. -
UNSUPPORTED_MEDIA_TYPE
The request'sContent-Typeis not supported (e.g., notapplication/json). -
PAYLOAD_TOO_LARGE
The request body exceeds the server's size limit. -
SERVICE_UNAVAILABLE
The server is temporarily unavailable (e.g., cluster health is red). -
NOT_ACCEPTABLE
The requested response format is not available (e.g., unsupportedAcceptmedia type). -
INTERNAL_ERROR
Unhandled server-side failure.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
code
Returns the stable wire code emitted in theerror.codefield 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
-