I have an internal API (A) which connects to 3rd party API (B).
API B can give below errors
- ERR001
- ERR002
API A has a error message configured for the same error code as below,
- ERR001 - Error1 occurred
- ERR002 - Error2 occurred
Now API A returns below incase of any error/exception
Response headers : HTTP/1.1 500 Internal Server Error
Response Body: {"time":"2000-04-..","errors":[{"code":"ERR001","message":"Error1 occurred"}],"details":"uri=/*","status":500}
Does setting up error status HTTP/1.1 500 Internal Server Error is more suitable for this situation?
Does wrapping the known error code as 500 status is good Idea?
If not which status code should i need to set and can i keep the same error structure?