We are planning to develop an API. There are so many cases that a request can be considered as a bad request.
For this, We have planned to send a JSON object with error code
, error
,
and additional info
I have put the sample case here when a user sends an illumination image. We considered as this request is bad request and send the following JSON
{
"ErrorCode": 10000,
"Error": "Detected uneven illumination image",
"Additional Info": "Prefer to change the image location"
}
- Is our JSON object format is good or we need to add the HTTP Error code like 400/404
- How to select this custom error code? We are planning to take the error code number from 10000.
Can someone please help us or provide some trustful resources?