ophyd icon indicating copy to clipboard operation
ophyd copied to clipboard

v2: Refactor and Test DeviceCollector Error Handling

Open callumforrester opened this issue 1 year ago • 3 comments

Changes:

  • Add tests to verify that DeviceCollector handles exceptions generated by connect()
  • 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

callumforrester avatar Aug 21 '23 16:08 callumforrester

Some additional issues have come out of this work https://github.com/bluesky/ophyd/issues/1152 https://github.com/bluesky/ophyd/issues/1153

callumforrester avatar Aug 21 '23 16:08 callumforrester

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 raises NotConnected 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 avatar Aug 29 '23 15:08 coretl

@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

callumforrester avatar Aug 30 '23 07:08 callumforrester

Superceded in ophyd-async

coretl avatar Apr 24 '24 15:04 coretl