smithy-lang / smithy-dafny

Apache License 2.0
9 stars 8 forks source link

fix(Java-SDK): handle generic service exceptions #466

Closed texastony closed 3 months ago

texastony commented 3 months ago

Issue #, if available:

SDK Exceptions that are not modeled by a service are treated as Opaque. In Java, this lead to an IllegalStateException, instead of a NotAuthorized Exception. This PR refactors the generated Java to capture un-modeled SDK exceptions, such as NotAuthorized, in the Opaque Error Types obj field, and un-wrap them.

Description of changes:

Replaces https://github.com/smithy-lang/smithy-dafny/pull/464

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