tursodatabase / turso-cli

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

`turso db destroy --instance` gives misleading error message when given a non-existent database #233

Closed CodingDoug closed 1 year ago

CodingDoug commented 1 year ago

If I issue a command targeting a database that doesn't exist:

$ turso db destroy non-existing-db --instance existing-instance-elsewhere
Error: instance not found

The error suggests that the named instance did not exist in the database, but it's the entire database that didn't exist. The error message could be more clear what specifically was not found.

Good general improvements would be:

haaawk commented 1 year ago

I think the error isn't incorrect. There is no existing-instance-elsewhere instance in non-existing-db and the fact that existing-instance-elsewhere exist in another database is not important. Instance X in database A is different than instance X in database B.

I do agree that pointing out that the db name is wrong is a better error though.