Error Responses
Error Response Format
Standard Error Response
{
"code": "ErrorCode",
"message": "Human-readable error description"
}Validation Error Response
{
"code": "ValidationError",
"errors": {
"fieldName": {
"type": "field",
"value": "invalid-value",
"msg": "Specific field error message",
"path": "fieldName",
"location": "body"
}
}
}HTTP Status Codes
2xx Success Codes
Code
Meaning
Usage
4xx Client Error Codes
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
413 Payload Too Large
429 Too Many Requests
5xx Server Error Codes
500 Internal Server Error
Error Handling Best Practices
Client-Side Error Handling
React Error Handling Example
Retry Logic with Exponential Backoff
Error Code Reference
Authentication Errors (AuthenticationError)
AuthenticationError)Message
Cause
Solution
Authorization Errors (AuthorizationError)
AuthorizationError)Message
Cause
Solution
Validation Errors (ValidationError)
ValidationError)Field
Common Messages
Solution
Business Logic Errors (BadRequest)
BadRequest)Message
Cause
Solution
Testing Error Scenarios
Monitoring and Logging
Last updated