Skip to content
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

abstract possible database errors #10

Open
Erik1000 opened this issue Oct 16, 2021 · 1 comment
Open

abstract possible database errors #10

Erik1000 opened this issue Oct 16, 2021 · 1 comment

Comments

@Erik1000
Copy link
Member

Since we can't expose sqlx' errors because we also have indexed db, we need to abstract that kind of errors.

Take a look at sqlx' errors enum and figure out which variants are worth to include. Also, maybe we should have a look at the IndexedDB API for errors that can occur there.

@Erik1000
Copy link
Member Author

Erik1000 commented Oct 16, 2021

  • I/O Error: if the sqlite database file is inaccessible, the sqlite connection string is malformed or if there's an error with indexeddb e.g. it's an unsupported browser
  • DuplicateError: if an entry already exists
  • MigrationError: if the database migration fails (both sqlite and indexeddb)

Also, we might add an special I/O Error OpenError for the cases, where the user needs to give allow the webapp to use indexedDB. This would also cover a permission error on the file system with sqlite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant