pymeasure: check_errors usage inconsistent
Our Instrument.check_errors() implementation returns a list of received errors (as its docstring says).
Interestingly though, where we use them, e.g. in control’s fget, https://github.com/pymeasure/pymeasure/blob/ebf6df97e229c0e916192a495ade65053b234ac3/pymeasure/instruments/instrument.py#L361, we simply discard those return values without doing anything!
I think where we use it we should do something with the errors, most probably log them.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 24 (24 by maintainers)
What do you think about a slight duplication of logging?
We could retain the current behaviour of default
check_errors, i.e.check_get/set_errorsdocument that they (if overridden) shallProperty fget/fset, if they receive an error during checking, log that error + useful context (command). So we might get
This way, we ensure that
Thoughts?