We should return an appropriate status code depending on the error (in this specific case, it should be a 409 Conflict) with an error message in the body:
Each type of error should also be associated with a numeric code.
This will allow the frontend to know exactly what went wrong and act appropriately.
For example, when a copy operation fails, it may return something like:
Clarification and motivation
When a command fails, the Web API returns a 200 status code with an error message in the body. For example, creating the same entry twice results in:
We should return an appropriate status code depending on the error (in this specific case, it should be a 409 Conflict) with an error message in the body:
Each type of error should also be associated with a numeric code. This will allow the frontend to know exactly what went wrong and act appropriately. For example, when a copy operation fails, it may return something like:
Or:
And the frontend will be able to match on the numeric code and decide what to do next.
We should create a markdown table in
/docs
with all the error codes and what they represent.Acceptance criteria