tursodatabase / tursodatabase/libsql-client-ts

Remote databases don't support raw error code

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

Nobody has claimed this yet.

enhancement good first issue help wanted
Dominant language
TypeScript
Stars
576
Forks
69
PR merge metrics
No merged PRs in 30d

Description

I disabled the raw error code tests in 846b2d0fc2f80fc9cb87bb1db4158857e8c7f54f for remote databases because we never set the error code for remote database errors:

export function mapHranaError(e: unknown): unknown {
    if (e instanceof hrana.ClientError) {
        const code = mapHranaErrorCode(e);
        return new LibsqlError(e.message, code, undefined, e);
    }
    return e;
}

(It's the undefined there after code when constructing LibsqlError)

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

Locate mapHranaError and the raw error code tests disabled in commit 846b2d0fc2f80fc9cb87bb1db4158857e8c7f54f. Check how mapHranaErrorCode is used when constructing LibsqlError and restore the expected remote-database error code behavior, then run the affected raw error code tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
sqlite, typescript
Domain
database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.