I'm writing a RESTful API with some endpoints to which clients can PUT or POST chunked files (using flow.js), including a payload digest among the metadata. The server also calculates digest and will throw an error if the digests don't match, in which case the client should attempt to retry the same request with no change (at least until some retry limit is reached).
None of the standard codes seem to fit well by definition. What is the best code to use? Is there any that fits somewhat by convention?
Note: for the purposes of integration with this library, the response must not be 404, 415, 500, or 501 as they will cancel the larger operation rather than retry this portion.
I also cannot use 409 because that is being used to identify attempts to upload multiple copies of the same file, which I believe is a better use of 409 anyway.
I cannot accept Matthew's answer because it's still suggesting one of the values I'm excluded from using - and I also believe 5xx errors aren't very appropriate where the error is in the client or the transport layer.
While still looking for better options, I'll for now propose (and use) a non-standard 4xx error, especifically
That particular value is being chosen for its proximity to codes handling errors of a similar nature and similarity to 409 which is perhaps the closest relation.
An anser will be chosen after a couple days, to provide opportunity for community concensus on a best practice approach.