tursodatabase / turso-cli

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

Empty (or invalid) settings.json yields unhelpful error message #533

Closed CodingDoug closed 1 year ago

CodingDoug commented 1 year ago

Something wiped out my settings.json and left an empty file there (no idea what happened), but now every time I run the CLI, for simple commands, I get the message:

$ turso db list
Error: could not read local settings

This is very problematic because it doesn't say where that file lives (could vary by platform), what the problem is with it, or how to recover. Ideally the output should name the file, the error, and make a recommendation to delete the file if it got corrupted.

CodingDoug commented 1 year ago

I found that it's also the case that using -c on the command line can cause this error to appear if the argument wasn't valid in some way, for example, specifying a file instead of a folder. This case could be improved as well.