Skip to content

Commit

Permalink
try raising exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rpatel3001 committed Mar 1, 2024
1 parent a3feed0 commit 3d6c17e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rootfs/scripts/soapy2tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def rx_thread(sdrcfg, rxStream, rxcfg, tx_init, inbufs, rxq):
sdr.closeStream(rxStream)
if environ.get("EXIT_ON_ERROR"):
print("[rx] Quitting script...")
interrupt_main()
raise OverflowError
else:
print("[rx] Quitting thread...")
return
Expand Down Expand Up @@ -169,6 +169,10 @@ def thread_wrapper(func, *args):
try:
print(f"[{func.__name__}] starting thread")
func(*args)
except OverflowError:
print(traceback.format_exc())
print(f"[{func.__name__}] exception; quitting script")
return
except BaseException:
print(traceback.format_exc())
print(f"[{func.__name__}] exception; restarting thread")
Expand Down

0 comments on commit 3d6c17e

Please sign in to comment.