Skip to content

Commit d7d0889

Browse files
committed
Capture make failure so it can be logged to sentry
1 parent 39c1e39 commit d7d0889

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

python/__init__.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99
import time
1010
import traceback
11+
import subprocess
1112
from dfu import PandaDFU
1213
from esptool import ESPROM, CesantaFlasher
1314
from flash_release import flash_release
@@ -25,7 +26,13 @@
2526

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

3037
def parse_can_buffer(dat):
3138
ret = []
@@ -541,4 +548,3 @@ def kline_recv(self, bus=2):
541548
msg = self.kline_ll_recv(2, bus=bus)
542549
msg += self.kline_ll_recv(ord(msg[1])-2, bus=bus)
543550
return msg
544-

0 commit comments

Comments
 (0)