Skip to content
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

Specify protocol specific error responses for non-operation errors #1368

Open
hlbarber opened this issue Aug 25, 2022 · 4 comments
Open

Specify protocol specific error responses for non-operation errors #1368

hlbarber opened this issue Aug 25, 2022 · 4 comments
Labels
documentation This is a problem with documentation. guidance Question that needs advice or information. server This issue involves the specification for server software.

Comments

@hlbarber
Copy link
Contributor

hlbarber commented Aug 25, 2022

At the time of writing, as far as I can tell, the AWS protocols specify how operation errors are serialized but does not specify how errors outside of that should be responded to.

For example, AWS restJson1 defines a set of Protocol Behaviours, one of which is

Every request for the awsJson1_0 protocol MUST be sent to the root URL (/) using the HTTP "POST" method.

but does not specify the response when a request is received which fails this criteria.

@hlbarber hlbarber changed the title Specify protocol specific error serialization for non-operation errors Specify protocol specific error responses for non-operation errors Aug 25, 2022
@adamthom-amzn
Copy link
Contributor

The existing service framework supports multiple protocols out of the box, and protocol handlers will refuse to claim a job that they don't think they can service. So in this case, the AWS/JSON 1.0 handler would not claim the job; if no handlers claimed the job, the default behavior would be an UnknownOperationException 404.

@adamthom-amzn
Copy link
Contributor

This sort of ambiguity is why future protocols are designed with specific protocol declaration headers instead of being bound by a set of matching criteria.

@hlbarber
Copy link
Contributor Author

hlbarber commented Aug 26, 2022

Returning UnknownOperationException + 404 on routing failure sounds reasonable. Should this be something that is covered by Smithy documentation/protocol tests? I'm hesitant to commit to behavior on the smithy-rs side before deliberation and a conclusion is made.

@hlbarber
Copy link
Contributor Author

hlbarber commented Aug 26, 2022

Smithy TypeScript generator has some relevant documented decisions: https://awslabs.github.io/smithy/2.0/ts-ssdk/error-handling.html#synthetic-errors

@kstich kstich added the guidance Question that needs advice or information. label Jul 24, 2023
@kstich kstich added the documentation This is a problem with documentation. label Aug 15, 2023
@kstich kstich added the server This issue involves the specification for server software. label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. guidance Question that needs advice or information. server This issue involves the specification for server software.
Projects
None yet
Development

No branches or pull requests

3 participants