Clarification on API Error Handling:HTTP Reason phrase on error response #108
Unanswered
sachinvodafone
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the Camara's error response, we have defined structured error responses for different scenarios. For example:
Conflict Error: When a conflict occurs, the client will receive an error response body like this:
{
"status": 409,
"code": "CONFLICT",
"message": "A human readable description of what the event represent"
}
Already Exists Error: When a client tries to create a resource that already exists, the error response body will be:
{
"status": 409,
"code": "ALREADY_EXISTS",
"message": "A human readable description of what the event represent"
}
These structured error responses include specific fields like status, code, and message to provide detailed information about the error and are part of the body of the HTTP response.
In addition to these specific error messages, there are generic HTTP status codes and reason phrases that are part of the HTTP response header. These status codes are standardized and indicate the overall result of the HTTP request.
As per my understanding:
Therefore In below screen shot, HTTP status should be "503 Service Unavailable" and not "503 Unavailable" and it is not advisable to synch it with the Camara error code.
So I would like to confirm if my understanding is fine on this.
Beta Was this translation helpful? Give feedback.
All reactions