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

EndpointsV2: Do not error without aws.api#service trait #644

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

everett1992
Copy link

@everett1992 everett1992 commented Nov 21, 2022

Without this commit the endpoint v2 generator will throw a generic NoSuchElementException when a service doesn't have both a aws.api#service and a aws.auth#sigv4 trait. This CR improves the error message to explain the required traits, and allows either a sigv4 or a service trait, but doesn't require both.

No aws.auth#sigv4 or aws.api#service trait, required for Endpoint default signing name

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Old error was a generic NoSuchElementException and was thrown even if a
sigv4 trait was defined but service was not.

Now we only throw if both are undefined and the exception explains that
the traits are required.

```
No aws.auth#sigv4 or aws.api#service trait, required for Endpoint default signing name
```
@everett1992 everett1992 requested a review from a team as a code owner November 21, 2022 22:09
@everett1992 everett1992 changed the title Improve endpoints error when missing traits EndpointsV2: Do not error without aws.api#service trait Dec 6, 2022
@srchase srchase merged commit 4060172 into smithy-lang:main Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants