hdtodd / rtl_433_stats

Catalog and analyze devices recorded in rtl_433 JSON logs
BSD 2-Clause "Simplified" License
13 stars 1 forks source link

"Python bare except" (catching all exceptions) #2

Closed rct closed 1 year ago

rct commented 1 year ago

Noticed this:

https://github.com/hdtodd/rtl_snr/blob/1ebca0986d983b8a53c7ddc600dffb7749dbb94d/py-version/SNR.py#L44

This is generally a bad idea since it will catch everything including interrupting with ctrl-c. It can also make you waste time chasing bugs when you can't see an error message.

First resource I googled that looked like a reasonable explanation - https://jerrynsh.com/stop-using-exceptions-like-this-in-python/

Google "python bare except" for plenty more.

hdtodd commented 1 year ago

Fixed in SNR.py and SNR-ITGT.py. Will patch rtl_watch and DNT shortly.