ophyd
ophyd copied to clipboard
v2: Refactor and Test DeviceCollector Error Handling
Changes:
- Add tests to verify that
DeviceCollector
handles exceptions generated byconnect()
- Add tests to verify that exceptions from devices failing to connect are logged
- Change error logging so that timeouts and exceptions from devices are logged in a uniform way
- Add comments to error handling code
- Make pre-existing tests that check the logs consistent with new tests
Some additional issues have come out of this work https://github.com/bluesky/ophyd/issues/1152 https://github.com/bluesky/ophyd/issues/1153
My aim would be the following:
- If
Device.connect()
raises, then report its traceback in full - If
Device.connect()
doesn't complete within timeout, cancel it, if it raisesNotConnected
then report the message text (which says which child signals are not connected) without traceback, otherwise report its traceback in full
This PR seems to report traceback for NotConnected errors too, do we want that?
@coretl To get to where you want, I think we would first have to fix https://github.com/bluesky/ophyd/issues/1153 This PR doesn't change the current behaviour except to make the log formatting more consistent. The information logged is the same. I suggest that sorting out exactly what is logged under which circumstances should be a separate PR. Possibly also a separate issue pulling together your comment and https://github.com/bluesky/ophyd/issues/1153
Superceded in ophyd-async