-
Notifications
You must be signed in to change notification settings - Fork 30
New 409 error code called INCOMPATIBLE_STATE #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
patrice-conil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Well...
...that is the same meaning defined in RFC 9110 for 409 Conflict:
Unfortunately, the existing status: 409
code: CONFLICT
message: A specified resource duplicate entry found.To avoid confusion with the standard, it may be better to align the existing CAMARA definition for CONFLICT with the RFC. Then if we specifically need an additional 'duplicate entry' error we can see if it should be a |
Well, certainly good to align CAMARA with the RFC. On the new status code: Note the difference between |
|
Thanks @tlohmar
So if I understand that correctly Have I got that right..? |
Yes. |
|
Maybe a question for clarification: Why are the 409 Error Codes so called "Syntax Exceptions"? |
Good question: the request can be sent with valid syntax and result in a 409. The API Design Guide distinguishes 'syntax exceptions' from 'service exceptions' and 'server errors' and that whole section may be worth revisiting... |
That's what we concluded during the meeting - any suggestions for more intuitive error codes taxonomy/listing are welcome (in new issue) |
artifacts/CAMARA_common.yaml
Outdated
| status: 409 | ||
| code: CONFLICT | ||
| message: A specified resource duplicate entry found. | ||
| GENERIC_409_WRONG_STATE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked about modifying to something like "INCOMPATIBLE_STATE"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @PedroDiez - indeed, 'incompatible' is more accurate here, because the state of the referenced resource is only 'wrong' in this specific context (i.e. it is not intrinsically 'wrong').
|
After some analysis, and also aligned with discussion in 10th November meeting, some simplificacion is also proposed: |
IMHO, the more generic term "CONFLICT" should be defined in the commonalities, while the more specific term "ALREADY EXISTS" in the context of an API should be defined in its specification. Is it really necessary/desirable to group all API error messages in commonalities? Perhaps we are over-specificating things. ;) |
|
Sorry for the delayed update of the PR. Please check.
The Error code |
Have understood to keep code |
You're right @PedroDiez… that's what I was trying to say. The 409_Conflict error with the code "CONFLICT" seems to be a generic error; any other variation would fall under an API's specialization. But if most people think differently, I'll accept it without any problem. I don't want to cause any conflict between us ;-) |
|
I would prefer to keep 409 CONFLICT in Commonalities, mainly to be closer to RFC 9110 wording |
ok. Co-authored-by: Pedro Díez García <pedro.diezgarcia@telefonica.com>
I dont understand this comment. CAMARA has introduced additional error codes to the HTTP status code Anyway, maybe we should keep this discussion separate from this PR. |
rartych
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PedroDiez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Kevsy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
patrice-conil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the changelog entry in the PR description does not fit to the PR content ("WRONG_STATE" vs "INCOMPATIBLE_STATE"). As we want to move towards more automation, this entry get's important.
Beyond that I would have the question if there is enough evidence that his is a traversal error code which is needed by more than one or two APIs. Otherwise we have in a few months a similar discussion as in #562. I couldn't find an issue for this PR where this was discussed.
Thanks for update the changelog entry. You can consider to edit also the PR title.
I will dismiss my blocking request for changes, as my analysis (cf. #562 (comment)) has shown that this new error code can replace several API specific error codes. But one prerequisite for it is that it is not restricted to referenced resources but also used if there is a conflicting state of the target resource. We can apply this change of your proposal after we have concluded the discussion in #562. The proposed code in Commonalities could be something like (description not binding for APIs, need to be adapted to the actual error): |
|
Seems reasonable to make this new EC applicable to both, the target and the referenced resource. |
|
After merging this PR I propose to improve 409 definitions with conclusions from #562 |
What type of PR is this?
What this PR does / why we need it:
The PR adds a new 409 Error Code called INCOMPATIBLE_STATE, indicating that the referenced resource in the request is in a wrong state for the requested operation.
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a breaking change?
Special notes for reviewers:
Changelog input
Additional documentation
This section can be blank.