swarm-cli icon indicating copy to clipboard operation
swarm-cli copied to clipboard

Consolidate error throwing and printing

Open Cafe137 opened this issue 4 years ago • 1 comments

The global error handler catches and prints all errors in a context-aware way, with an unified design.

However, there are several cases, where errors are caught in the command business logic, and custom error messages are printed, followed by an exit(1) call.

It would be better to re-throw an error in these cases, so that the global error handles takes care of it consistently.

Cafe137 avatar Oct 07 '21 18:10 Cafe137

Also make sure global error handler sets exit code to 1

Cafe137 avatar Oct 07 '21 19:10 Cafe137