My service B
is part of a chain of services and calls a downstream service C
.
A --> B --> C
Service C
is returning HTTP 500 errors for any error it faced, including bad requests or input validation errors that normally should be 4** errors.
There is no option to change / update service C.
Since service B is stuck between the calling application A and service C, there are many occasions that service C will return HTTP 500 only because the input params sent by A are wrong.
As the writer of service B, I'm not aware of the different validation service C will do on the input and I definitely don't want to duplicate them in B.
I wonder what should be the best HTTP error code to return when C returns 500? At the moment I can't differentiate between real server error or bad input.
The problem with return whatever C returns to you
is that whenever my service returns 500 error, we will need to start debugging and understanding if the cause of the error is from B or it is just a propagation of the error from service C.
A
a client,B
your service, andC
a third-party application?