gearbox icon indicating copy to clipboard operation
gearbox copied to clipboard

Provide a replacement for Paster BadCommand

Open amol- opened this issue 6 years ago • 0 comments

Paster BadCommand is not available and must be handled manually, terminating with sys.exit(1).

In Paster raising an exception named BadCommand allowed to quit with an error message ( see https://github.com/Pylons/pylons/blob/master/pylons/commands.py#L107 ).

This is no longer possible in gearbox and requires to call sys.exit which abruptly quits the application. raising BadCommand and trapping it into gearbox as a signal that you shoudl gracefully quit was a better pattern.

By default it should quit with a 1 exit code, but it should be possible to provide a custom one when raising the BadComand exception.

amol- avatar Jul 16 '17 20:07 amol-