Support for framework exceptions #295
Merged
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.
Description of changes:
The most controversial part of this, I expect, will be the hand-built static model for these that I use to reuse the code generators. I wonder if I should replace the context's
SymbolProvider
as well, in the event one of the error serialization implementations tries to do a symbol lookup. I didn't go to those lengths in this review because I'm unsure framework errors will ever be much more than a name, a status code and a message.In the future, if we allow customization of the namespace of the framework exceptions for backwards compatibility with existing services, the static model will have to turn into a model factory of some sort.
You can take a look at the generation changes here: https://github.com/adamthom-amzn/smithy-typescript-ssdk-demo/commit/503b7ae1be16113be2fbcc1cf8af3d1ded01cbb9 and the TS definitions of the framework exceptions here: https://github.com/adamthom-amzn/smithy-typescript-ssdk-demo/commit/64ec3c51f7e0583eed61770d15c8479d4b1949ce
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.