File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,22 +80,17 @@ except:
8080 kill $SSE_PID 2> /dev/null
8181 wait $SSE_PID 2> /dev/null
8282
83- # Analyze results from events
83+ # Analyze final notebook state (accounts for reruns overwriting earlier errors)
8484 CRASHED=$( grep -c ' "crashed"' " $EVENTS_FILE " 2> /dev/null || echo 0)
8585 RESULT_COUNT=$( grep -c ' "cellResult"' " $EVENTS_FILE " 2> /dev/null || echo 0)
8686
87- # Extract cell errors from events
88- CELL_ERRORS=$( grep ' "cellResult"' " $EVENTS_FILE " | sed ' s/^data: //' | python3 -c "
87+ CELL_ERRORS=$( curl -s --max-time 10 " $BASE /api/notebook" 2> /dev/null | python3 -c "
8988import sys,json
89+ nb=json.load(sys.stdin)
9090errors=[]
91- for line in sys.stdin:
92- line=line.strip()
93- if not line: continue
94- try:
95- ev=json.loads(line)
96- if ev.get('error'):
97- errors.append(f'cell {ev[\" cellId\" ]}: {ev[\" error\" ][:120]}')
98- except: pass
91+ for c in nb['nbCells']:
92+ if c['cellType']=='CodeCell' and c.get('cellError'):
93+ errors.append(f'cell {c[\" cellId\" ]}: {c[\" cellError\" ][:120]}')
9994for e in errors:
10095 print(e)
10196" 2> /dev/null)
You can’t perform that action at this time.
0 commit comments