Skip to content

fix(utils): extract provider error fields from response data directly#5634

Open
hassan254-prog wants to merge 1 commit intomasterfrom
wari/add-more-test-to-stringifyerror
Open

fix(utils): extract provider error fields from response data directly#5634
hassan254-prog wants to merge 1 commit intomasterfrom
wari/add-more-test-to-stringifyerror

Conversation

@hassan254-prog
Copy link
Contributor

@hassan254-prog hassan254-prog commented Mar 13, 2026

Describe the problem and your solution

  • Widen this to extract provider error fields directly from the response data instead of reading them from the error object.

Adjust provider error extraction from response.data in stringifyError

Updates stringifyError to extract whitelisted provider error fields directly from response.data rather than only from a nested response.data.error object, skipping object values to avoid nested payloads. Tests in packages/utils/lib/errors.unit.test.ts are revised and expanded to cover top-level field extraction, invalid structures, and priority over Boom payloads.


This summary was automatically generated by @propel-code-bot

@hassan254-prog hassan254-prog self-assigned this Mar 13, 2026
Copy link
Contributor

@propel-code-bot propel-code-bot bot left a comment

Choose a reason for hiding this comment

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

No issues found; changes appear correct and tests cover expected behavior.

Status: No Issues Found | Risk: Low

Review Details

📁 2 files reviewed | 💬 0 comments

Instruction Files
├── .claude/
│   ├── agents/
│   │   └── nango-docs-migrator.md
│   └── skills/
│       ├── agent-builder-skill/
│       │   ├── EXAMPLES.md
│       │   └── SKILL.md
│       ├── creating-integration-docs/
│       │   └── SKILL.md
│       └── creating-skills-skill/
│           └── SKILL.md
├── AGENTS.md
└── GEMINI.md

@hassan254-prog hassan254-prog requested a review from a team March 13, 2026 14:04
if (!(field in responseData)) {
continue;
}
const value = (responseData as Record<string, unknown>)[field];
Copy link
Collaborator

Choose a reason for hiding this comment

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

we are changing the semantic of the logic, not looking at responseData.error anymore but responseData. Anything in .error will be skipped since in the line below object value are filtered out.
Are we not breaking current behavior?

continue;
}
const value = (responseData as Record<string, unknown>)[field];
if (typeof value !== 'object' || value === null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why value === null?

@linear
Copy link

linear bot commented Mar 16, 2026

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.

2 participants