Skip to content

Commit

Permalink
waf: let wrapper exit with error
Browse files Browse the repository at this point in the history
It's not useful to raise an excpetion because it will only report the
command called exit with an error. Just return an error code instead of
rasing an exception. This way we get nicer error messages:

    ./waf unknowncommand
    No function unknowncommand defined in /home/lucas/p/dronecode/ardupilot/wscript

vs

    ./waf unknowncommand
    No function unknowncommand defined in /home/lucas/p/dronecode/ardupilot/wscript
    Traceback (most recent call last):
      File "./waf", line 15, in <module>
        raise e
    subprocess.CalledProcessError: Command '['python', '/home/lucas/p/dronecode/ardupilot/modules/waf/waf-light', 'unknowncommand']' returned non-zero exit status 1
  • Loading branch information
lucasdemarchi committed Sep 29, 2016
1 parent 4b2eeda commit 0ad3b04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion waf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ try:
subprocess.check_call(['python', waf_light] + sys.argv[1:])
except subprocess.CalledProcessError as e:
if e.returncode != 2 or p.isfile(waf_light):
raise e
sys.exit(1)

print('Missing waf submodule. Trying to get it')

Expand Down

0 comments on commit 0ad3b04

Please sign in to comment.