endail / hx711

Raspberry Pi HX711 C++ Library
MIT License
19 stars 11 forks source link

Catch is too specific - needs to be generalised #39

Closed endail closed 2 years ago

endail commented 2 years ago

https://github.com/endail/hx711/blob/de87c5b54282c7e86e214a7ec04d64beda106735/src/HX711.cpp#L282

Restoring the backup gain and channel will be missed for exceptions other than TimeoutException.

Suggest catching base std::exception, restoring config, then rethrowing instead.