Skip to content

Add automated error mapping for custom Astroid API error codes #110

Description

@Cjay-Cyber-2

Description — what to implement and the why/impact.

Add robust error mapping across client responses in @astroid/client to translate raw HTTP error payloads into strongly-typed SDK error classes.

Context & Requirements — background, constraints, design references, edge cases;

Background: Developers need specific error classes (e.g. BudgetExceededError, PolicyViolationError) rather than generic HTTP errors to handle failure cases gracefully in agent code.
Constraints: Must preserve original error details, stack traces, and status codes.

Acceptance Criteria — a checklist ("- [ ] ...") of specific, testable conditions that define "done".

  • Custom error classes defined and exported across workspace packages
  • Response interceptor in @astroid/client maps error codes to specific SDK errors
  • Unit tests verify correct error instantiation for various API error responses

Implementation Guidance — likely files/modules to touch (use real paths from the repo context)

Check error handling modules under packages/client/src/ and shared types or error definitions.

Testing & Validation — how the contributor should prove it works

Run pnpm test across the workspace to ensure error mapping tests pass successfully.

Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting.


Wave complexity: Medium

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions