fix(ai-proxy): use proper AI error classes instead of generic Error#1520
Merged
fix(ai-proxy): use proper AI error classes instead of generic Error#1520
Conversation
d60aef7 to
7eb24c5
Compare
- ForestIntegrationClient.checkConnection(): Error → AIBadRequestError - assertResponseOk(): Error → AIToolUnprocessableError - Add CLAUDE.md with error handling guidelines Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7eb24c5 to
e5b5dd1
Compare
nbouliol
approved these changes
Mar 31, 2026
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (2)
🛟 Help
|
forest-bot
added a commit
that referenced
this pull request
Mar 31, 2026
## @forestadmin/ai-proxy [1.7.1](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/ai-proxy@1.7.0...@forestadmin/ai-proxy@1.7.1) (2026-03-31) ### Bug Fixes * **ai-proxy:** use proper AI error classes instead of generic Error ([#1520](#1520)) ([54ff837](54ff837))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
ForestIntegrationClient.checkConnection()threwnew Error(...)for unsupported integrations → now throwsAIBadRequestErrorassertResponseOk()in Zendesk utils threwnew Error(...)for API failures → now throwsAIToolUnprocessableErrorCLAUDE.mdto ai-proxy package with error handling guidelinesWithout proper error classes, the agent's error middleware maps these to a generic 500 instead of the correct HTTP status code.
Test plan
🤖 Generated with Claude Code
Note
Replace generic
Errorwith typed AI error classes inai-proxyForestIntegrationClient.checkConnectionnow throwsAIBadRequestErrorinstead of a genericErrorfor unsupported integrations.zendesk/utils.assertResponseOknow throwsAIToolUnprocessableErrorinstead of a genericErroron non-OK responses.src/errors.ts.Macroscope summarized e5b5dd1.