Closed leloup314 closed 1 year ago
Patch coverage: 100.00
% and project coverage change: +0.05
:tada:
Comparison is base (
c29871f
) 32.91% compared to head (428dc30
) 32.96%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@themperek any reason that SCPI
hardware layer shout not raise an AttributeError
when dynamically-generated method from __getattr__
tries to call SCPI command that does not exist? We are testing for a ValueError
on any exception at the moment but that is probably not needed
@leloup314 I would be fine with this but this part is from @DavidLP
Probably will break peoples code... I guess it is not worth to change it for now.
This PR adds more streamlined exception handling for the SCPI
HL
.Currently, when the dynamically-generated method fails to create a SCPI command because of any exception, the bare exception is excepted and a
ValueError
is raised within the exception handling. Due to Pythons exception chaning, this produces a confusing traceback, not clearlyindictaing that no such attribute is available.This PR changes this behavior by
AttributeError
if no such SCPI method is availableThis mirrors the expected behaviour of
arbitrary_object.non_existing_method()
generating anAttributeError