Skip to content

fix: Resolve Exception#detailed_message name collision#3384

Merged
jterapin merged 4 commits into
version-3from
fix-exception-name-collision
May 15, 2026
Merged

fix: Resolve Exception#detailed_message name collision#3384
jterapin merged 4 commits into
version-3from
fix-exception-name-collision

Conversation

@jterapin
Copy link
Copy Markdown
Contributor

Fixes #3383


Summary

  • Fix name collision between generated detailed_message accessor on NeptuneData error classes and Ruby 3.2+ Exception#detailed_message(highlight:, **)
  • Generated accessor now uses kwargs-based dispatch: no-arg calls return the API field, calls with keyword arguments (e.g., from full_message) delegate to super
  • Adds exception_method flag to error codegen, separate from existing shared flag

Context

NeptuneData is the only AWS service whose error shapes have a detailedMessage member. The generated zero-arg def detailed_message shadowed Ruby 3.2+'s Exception#detailed_message(highlight:, **), causing ArgumentError when full_message is called (triggered by OpenTelemetry, logging frameworks, etc.).

Testing

Tested locally with Ruby 3.0 and Ruby 4.0
Expected code-generated changes: 99ec980

@jterapin jterapin requested a review from a team as a code owner May 14, 2026 16:32
Copy link
Copy Markdown
Contributor

@sichanyoo sichanyoo left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Copy Markdown
Contributor

@richardwang1124 richardwang1124 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jterapin jterapin merged commit 56b3aa1 into version-3 May 15, 2026
34 checks passed
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.

Name collision of detailed_message method between Exception classes in aws-sdk-neptunedata gem and Ruby 3.2+

3 participants