Skip to content

Conversation

@Madrigal
Copy link
Contributor

Issue #, if available:

Description of changes:
There's an ongoing discussion about the right way to match errors on CBOR. This would be one way of checking only against shape name instead of against shapeId. Don't merge this until the discussion is finalized

Diff would look like (typ is the full shape id)

-     switch string(typ) {
-     case "com.amazonaws.cloudwatch#ResourceNotFound": 
+     // namespace can be mangled by service, so matching by error shape name
+     errorParts := strings.Split(typ, "#")
+     errorName := errorParts[len(errorParts)-1]
+     switch string(errorName) {
+     case "ResourceNotFound": 

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

));
}

private String getShapeName(ShapeId id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is this new function used anywhere?

@lucix-aws lucix-aws marked this pull request as ready for review June 27, 2025 19:27
@lucix-aws lucix-aws requested review from a team as code owners June 27, 2025 19:27
@lucix-aws lucix-aws merged commit ec0c802 into main Jun 27, 2025
15 checks passed
@lucix-aws lucix-aws deleted the fix-match-cbor-error-via-shapename-only branch June 27, 2025 19:27
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.

3 participants