Closed marceloalcocer closed 9 months ago
Hi @marceloalcocer
Thanks for creating the issue. You are right that the error handling and the output messages can be improved to reflect better why the values are not valid. I created a PR (https://github.com/ALBA-Synchrotron/sardana-tango/pull/17) following your suggestions to improve them.
Best regards.
Hej @ovallcorba
Thanks for taking the time to look into this and crafting a PR :+1:
The
TangoAttrIORController.ReadOne
method returnsNone
on invalid (out-of-bounds) values of the underlying Tango attribute. This return value does not conform to the Sardana API forReadable
controllers (see e.g. SEP6).More specifically, TangoAttrIORController.ReadOne asserts the underlying Tango attribute value is within the calibrated bounds, and raises an exception on assertion failure. This exception is subsequently caught, but no value is returned or exception raised in the handler.
The ultimate result of this is that the pool raises a
ValueError
(with generic message) when attempting to read thevalue
of an IOR device whose underlying Tango attribute is our of bounds, e.g.;As the original exception is not re-raised, its relevant explanatory message (
"Invalid position."
) is suppressed. Although currently suppressed, this message itself could also be improved, e.g.;