Skip to content

Feature request: expose HTTP status code on RepositoryError #479

Description

@vera

It would be helpful if RepositoryError exposed the underlying HTTP status code when available.

Applications may need to handle different failure cases differently, e.g. 404 Not found, 401/403 permission denied, and 500 or other server errors.

Currently callers can inspect the error message/reason, but it's not straightforward to extract the actual status code from there.

I propose adding an optional property such as statusCode?: number to RepositoryError and ensuring repository errors created from HTTP responses populate it.

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions