You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw BAD_REQUEST as an example rather than a strict choice. I used PRECONDITION_FAILED because the request itself is valid, but it does not satisfy the requirement enforced by the server, which felt closer to a precondition than a malformed request.
That said, I’m fine switching to BAD_REQUEST if we prefer keeping it simpler and more general.
Thanks for the explanation, it's true that BAD_REQUEST does not appear as the final choice from my comment in the issue indeed. The reasoning makes sense, but I would still lean toward BAD_REQUEST:
The HTTP 412 Precondition Failed client error response status code indicates that access to the target resource was denied. This happens with conditional requests on methods other than GET or HEAD when the condition defined by the If-Unmodified-Since or If-Match headers is not fulfilled. In that case, the request (usually an upload or a modification of a resource) cannot be made and this error response is sent back.
400 seems more generic and details would come from the returned JSON.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #542
Change:
Replace UPGRADE_REQUIRED (426) with PRECONDITION_FAILED (412)