Skip to content

fix(java): use client-class-name for exception type in README#14045

Merged
jsklan merged 2 commits intomainfrom
devin/1774459531-fix-java-readme-exception-class-name
Mar 25, 2026
Merged

fix(java): use client-class-name for exception type in README#14045
jsklan merged 2 commits intomainfrom
devin/1774459531-fix-java-readme-exception-class-name

Conversation

@jsklan
Copy link
Copy Markdown
Contributor

@jsklan jsklan commented Mar 25, 2026

Description

When client-class-name is specified in the Java generator custom config, the v1 generator creates an exception class named {clientClassName}ApiException. However, the v2 README generator was ignoring client-class-name and always using {org}ApiException (via getBaseNamePrefix()), causing the README's exception handling snippet to reference a class that doesn't exist in the SDK.

Changes Made

  • Updated getApiExceptionClassName() in SdkGeneratorContext.ts to check client-class-name before falling back to getBaseNamePrefix(), matching v1's logic in ClientPoetClassNameFactory.getApiErrorClassName()
  • Added changelog entry (version 4.0.5)

Priority chain is now:

  1. base-api-exception-class-name (explicit override) — unchanged
  2. client-class-name + "ApiException"new
  3. getBaseNamePrefix() + "ApiException" (org-based default) — unchanged

Human Review Checklist

  • Verify the fallback priority matches v1's ClientPoetClassNameFactory.getApiErrorClassName() at generators/java/sdk/src/main/java/com/fern/java/client/ClientPoetClassNameFactory.java:160-167
  • Consider whether similar client-class-name awareness is missing in other v2 naming methods (e.g., getBaseExceptionClassName equivalent if one exists)

Testing

  • Unit tests added/updated
  • Verified pre-existing compile errors are unrelated to this change
  • Manual testing completed

Link to Devin session: https://app.devin.ai/sessions/3cb0ef910a644cf7b635abc52e59943b
Requested by: @jsklan


Open with Devin

Co-Authored-By: judah <jsklan.development@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@jsklan jsklan marked this pull request as ready for review March 25, 2026 17:38
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.

Once credits are available, reopen this pull request to trigger a review.

@jsklan jsklan enabled auto-merge (squash) March 25, 2026 17:39
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@jsklan jsklan merged commit 2174f1c into main Mar 25, 2026
126 of 155 checks passed
@jsklan jsklan deleted the devin/1774459531-fix-java-readme-exception-class-name branch March 25, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants