Closed Bug 1387307 Opened 3 years ago Closed 3 years ago
Command Error(message, exit _code) s .t . mach won't print a stack-trace
Simply a way to communicate expected errors nicely without littering our code with: print(...) sys.exit(1) which makes it hard to reuse code for anything other than the command it was written for.
Attachment #8893638 - Flags: review?(gps)
Comment on attachment 8893638 [details] Bug 1387307 - Add FailedCommandError to mach https://reviewboard.mozilla.org/r/164740/#review170954 ::: python/mach/mach/main.py:457 (Diff revision 1) > return Registrar._run_command_handler(handler, context=context, > debug_command=args.debug_command, **vars(args.command_args)) > except KeyboardInterrupt as ki: > raise ki > + except FailedCommandError as e: > + print(e.message, file=sys.stderr) While stderr is arguably the correct destination, other error handling code in this file writes to stdout. So let's drop `file=sys.stderr` and write to stdout.
Attachment #8893638 - Flags: review?(gps) → review+
Assignee: nobody → jopsen
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/f5a478a70af0 Add FailedCommandError to mach r=gps
You need to log in before you can comment on or make changes to this bug.