Add support for the 409 Conflict status code - #77
Merged
JackThomson2 merged 1 commit intoJul 30, 2026
Conversation
Add a Conflict variant to the StatusCode enum so that responses can report the 409 status code, and map it to its raw representation. Signed-off-by: Stepan Rabotkin <epicstyt@gmail.com>
Contributor
Author
|
@ShadowCurse @Manciukic @ilstam could you take a look at this PR when you get a chance? Happy to walk through anything that's unclear. Thanks! |
ilstam
approved these changes
Jul 29, 2026
JackThomson2
approved these changes
Jul 29, 2026
JackThomson2
enabled auto-merge (rebase)
July 29, 2026 20:38
Contributor
Author
|
The doctest failure in CI here is unrelated to this change - it's the |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reason for This PR
Cloud Hypervisor uses this crate for its HTTP API, and I want to answer some API
errors with 409 Conflict.
StatusCodeis a closed enum, so that is not possibletoday.
Description of Changes
Add a
Conflictvariant toresponse::StatusCodeand map it tob"409"inStatusCode::raw(). The variant is placed afterMethodNotAllowedto keep theenum ordered by status code. Unit test extended accordingly.
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.
PR Checklist
git commit -s).unsafecode is properly documented.CHANGELOG.md.