IQSS / IQSS/dataverse-client-javascript

Feature request: expose HTTP status code on `RepositoryError`

Open
#479 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
20
Forks
11
Avg merge
2d 5h
Merged PRs (30d)
1

Description

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

  • #142

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating RepositoryError and the code that creates repository errors from HTTP responses; no file or test path is named in the issue. Inspect existing error tests, then add coverage showing that available status codes are exposed while errors without one remain valid. Done means callers can read the status code for HTTP failures, including the stated 404, 401/403, and server-error cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.