Skip to content

Commit

Permalink
fix build.py missing error handling (influxdata#877)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Cook authored Sep 7, 2016
1 parent c4953cf commit 5fd1a33
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ def run(command, allow_failure=False, shell=False, printOutput=False):
out, _ = p.communicate()
if out is not None:
out = out.decode('utf-8').strip()
except subprocess.CalledProcessError as e:
if allow_failure:
logging.warn("Command '{}' failed with error: {}".format(command, e.output))
return None
else:
logging.error("Command '{}' failed with error: {}".format(command, e.output))
sys.exit(1)
if p.returncode != 0:
if allow_failure:
logging.warn("Command '{}' failed with error: {}".format(command, out))
return None
else:
logging.error("Command '{}' failed with error: {}".format(command, out))
sys.exit(1)
except OSError as e:
if allow_failure:
logging.warn("Command '{}' failed with error: {}".format(command, e))
Expand Down

0 comments on commit 5fd1a33

Please sign in to comment.