Interface ApiErrorCode
- All Known Implementing Classes:
BadRequestApiErrorCode,ConflictApiErrorCode,ForbiddenApiErrorCode,InternalServerErrorApiErrorCode,MethodNotAllowedApiErrorCode,NotFoundApiErrorCode,ServiceUnavailableApiErrorCode,TooManyRequestsApiErrorCode,UnauthorizedApiErrorCode,UnprocessableEntityApiErrorCode
public interface ApiErrorCode
Common interface for all API error code enums.
Each HTTP status code has its own enum implementing this interface:
BadRequestApiErrorCode- 400 errorsUnauthorizedApiErrorCode- 401 errorsForbiddenApiErrorCode- 403 errorsNotFoundApiErrorCode- 404 errors- etc.
Use this interface when you need to handle error codes generically, or use the specific enum class for type-safe handling of status-specific codes.
-
Method Summary
-
Method Details
-
getValue
String getValue()Get the string value of this error code as returned by the API.- Returns:
- the API string value, or null for unknown codes
-
isKnown
boolean isKnown()Check if this error code is a known (non-unknown) value.- Returns:
- true if this is a recognized error code
-
name
String name()Get the enum name (e.g., "DUPLICATE_ENTRY", "PAYMENT_PROCESSING_FAILED").- Returns:
- the enum constant name
-