kindly / flatterer

Opinionated JSON to CSV/XLSX/SQLITE/PARQUET converter. Flattens JSON fast.
https://flatterer.opendata.coop
MIT License
182 stars 7 forks source link

Hide backtrace behind --verbose (-v) for known potential errors #22

Closed jpmckinney closed 2 years ago

jpmckinney commented 2 years ago

I'm not sure that the backtrace for the cases in #17 is useful to a typical user. Most non-expert users, in my experience, do not know where to look in long outputs, and the backtrace is incomprehensible to them. Even to an expert user, the backtrace suggests that the error is unhandled/unexpected, whereas these are errors that Flatterer actually knows can occur.

I suggest that the backtrace in these cases can be displayed only in verbose mode.

kindly commented 2 years ago

Agreed. I am working on #15 by trying log more relevently to the user and have already removed the backtrace for the CLI output.

I will unliley use a verbose option though, just log levels and an evironment variable for that. The python backtraces are mostly only really useful if you are using the python API as the python layer for the CLI is pretty thin on top of the rust one. Better logs are more helpful when working out what happend in the rust code.

It may well backtrace though in either language if the error is one that is unexpected.

kindly commented 2 years ago

No tracebacks will be shown except for unkown erros. Just an error level log which will be shown to the users. These error logs will be suppressed if using the Python API as the tracebacks will be more useful in that case.