API Testing · Senior · Question 39 of 75
How should error responses be covered by contracts?
- 1Only 500 errors need contracts, since 4xx are client problems
- 2Errors should never be part of a contract between services
- 3Contract the error format and codes clients rely on, not only success
Show the answer
Correct answer: Contract the error format and codes clients rely on, not only success
Explanation
Clients branch on 409 or specific error codes. Changing them breaks clients as surely as changing a success field.