tursodatabase / turso-cli

Command line interface to Turso.
https://turso.tech
MIT License
223 stars 37 forks source link

Improve error messages for database/instance not found #238

Closed haaawk closed 1 year ago

haaawk commented 1 year ago
haaawk commented 1 year ago

It seems that most cases of non-existing database are covered:

╰──> ./turso db destroy foo
Database foo, all its replicas, and data will be destroyed.
Are you sure you want to do this? [y/n]: y
Error: database foo not found. List known databases using turso db list
╰──> ./turso db shell foo
Error: database foo not found. List known databases using turso db list
╰──> ./turso db show foo
Error: database foo not found. List known databases using turso db list
╰──> ./turso db replicate foo ams
Error: database foo not found. List known databases using turso db list
╰──> ./turso db change-password foo -p "test"
Error: database foo not found. List known databases using turso db list
╰──> ./turso db show foo --instance-url bar
Error: database foo not found. List known databases using turso db list

The only not covered case I found is:

╰──> ./turso db destroy foo --instance bar
Error: could not find database foo to delete instance from
haaawk commented 1 year ago

For instances both cases I can identify need to be improved:

╰──> ./turso db show t --instance-url foo
Error: instance foo of database t not found
╰──> ./turso db destroy t --instance foo
Error: could not find instance foo of database t