tursodatabase / tursodatabase/libsql-client-ts
Remote databases don't support raw error code
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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