Skip to content

Commit

Permalink
Merge pull request commaai#160 from commaai/capture_make_failure
Browse files Browse the repository at this point in the history
Capture make failure so it can be logged to sentry
  • Loading branch information
legonigel authored Feb 21, 2019
2 parents 7b504d2 + d7d0889 commit 0b2327e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import time
import traceback
import subprocess
from dfu import PandaDFU
from esptool import ESPROM, CesantaFlasher
from flash_release import flash_release
Expand All @@ -25,7 +26,13 @@

def build_st(target, mkfile="Makefile"):
from panda import BASEDIR
assert(os.system('cd %s && make -f %s clean && make -f %s %s >/dev/null' % (os.path.join(BASEDIR, "board"), mkfile, mkfile, target)) == 0)
cmd = 'cd %s && make -f %s clean && make -f %s %s >/dev/null' % (os.path.join(BASEDIR, "board"), mkfile, mkfile, target)
try:
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError as exception:
output = exception.output
returncode = exception.returncode
raise

def parse_can_buffer(dat):
ret = []
Expand Down Expand Up @@ -541,4 +548,3 @@ def kline_recv(self, bus=2):
msg = self.kline_ll_recv(2, bus=bus)
msg += self.kline_ll_recv(ord(msg[1])-2, bus=bus)
return msg

0 comments on commit 0b2327e

Please sign in to comment.