New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
astro:db
: Astro remote db not returning SQL error info
#10810
Labels
Comments
timsexperiments
changed the title
Astro DB: Astro studio remote db not returning error codes.
astro:db: Astro studio remote db not returning error codes.
Apr 18, 2024
timsexperiments
changed the title
astro:db: Astro studio remote db not returning error codes.
astro:db: Astro remote db not returning error codes.
Apr 18, 2024
timsexperiments
changed the title
astro:db: Astro remote db not returning error codes.
Apr 18, 2024
astro:db
: Astro remote db not returning error codes.
timsexperiments
changed the title
Apr 18, 2024
astro:db
: Astro remote db not returning error codes.astro:db
: Astro remote db not returning SQL error info
matthewp
added
- P2: nice to have
Not breaking anything but nice to have (priority)
pkg: db
and removed
needs triage
Issue needs to be triaged
labels
Apr 22, 2024
Thanks for reporting this @timsexperiments! We've updated the production error object to a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When running astro with the astro db plugin, I would expect the
LibsqlError
details to be included in theAstroDbError
. This way I can handle different sql error codes (e.g. unique constraint violations) as I want within my code:Current result:
Example class with added details from original error (utils.ts):
Example error building with
cause
as the original error (db-client.ts
):What's the expected result?
I would expect some sort of details about what type of error occurred on the
AstroDbError
(e.g.SQLITE_CONSTRAINT_UNIQUE
):{ + "cause": { ... }, "type": "AstroUserError", "hint": "See the Astro DB guide for query and push instructions: https://docs.astro.build/en/guides/astro-db/#query-your-database", "name": "Astro DB Error", "message": "UNIQUE constraint failed: Item.value" }
Link to Minimal Reproducible Example
https://stackblitz.com/~/github.com/timsexperiments/astro-db-test
Participation
The text was updated successfully, but these errors were encountered: