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

More helpful errors #103

Open
4 tasks
marcua opened this issue Jun 4, 2023 · 0 comments
Open
4 tasks

More helpful errors #103

marcua opened this issue Jun 4, 2023 · 0 comments

Comments

@marcua
Copy link
Owner

marcua commented Jun 4, 2023

  • All AybErrors are of one type with a message, which makes it hard to handle them programatically. Consider making each error have its own type and/or use an enum for them.
  • Referencing the wrong entity results in Error: RowNotFound
$:~/Downloads/ayb$ ayb client register newcua
Error: Entity already exists
$:~/Downloads/ayb$ ayb client create_database marcua/test.sqlite
Error: Entity not found: "marcua"
$:~/Downloads/ayb$ ayb client create_database newcua/test.sqlite
Successfully created newcua/test.sqlite
$:~/Downloads/ayb$ ayb client query marcua/test.sqlite "CREATE TABLE favorite_databases(name varchar, score integer);"
Error: RowNotFound
$:~/Downloads/ayb$ ayb client query newcua/test.sqlite "CREATE TABLE favorite_databases(name varchar, score integer);"

Rows: 0
  • From implementation in https://github.com/marcua/ayb/blob/main/src/error.rs translates the text of the errors, but doesn't show the example. e.g., AddressError says an email address was parsed wrong, but was it the to/from/reply_to? What was the actual email that wasn't valid?
  • Better utilize actix's error handling functionality with typed AybErrors to modify return types (e.g., return 403/Forbidden on permissions errors, etc.)
@marcua marcua changed the title More helpful error messages More helpful errors Oct 29, 2023
@marcua marcua moved this to To do in ayb roadmap Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

No branches or pull requests

1 participant