Skip to content

70 support different errors with the same http status code#71

Merged
tomsontom merged 3 commits into
mainfrom
70-support-different-errors-with-the-same-http-status-code
Jun 25, 2026
Merged

70 support different errors with the same http status code#71
tomsontom merged 3 commits into
mainfrom
70-support-different-errors-with-the-same-http-status-code

Conversation

@tomsontom

Copy link
Copy Markdown
Member

No description provided.

@tomsontom tomsontom linked an issue Jun 25, 2026 that may be closed by this pull request
@tomsontom

Copy link
Copy Markdown
Member Author

Review

This PR adds support for multiple distinct errors sharing the same HTTP status code (#70). Traced the generated output (Java JDK client, TS fetch client, OpenAPI JSON) for the new multiErrorSameCode sample operation and confirmed the dispatch/fallthrough logic (if (status == X) { if (header == "ErrorName") {...} }) is correct in all generators, and the OpenAPI oneOf collection for multiple errors per status code works as intended.

One cleanup item:

dsl/packages/cli/src/open-api/service.ts:113-164 — dead commented-out code left over from the refactor. A ~50-line block of the old per-result error-handling logic (/*if (r.error) {...}*/) is left commented out inside the .forEach that now only handles non-error results. It's unreachable and duplicates logic that now lives in toErrorType/errorsByCode.forEach below — should be deleted.

🤖 Generated with Claude Code

@tomsontom tomsontom merged commit 5b1c1e7 into main Jun 25, 2026
2 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.

Support different errors with the same HTTP-Status-Code

1 participant