Skip to content

Commit 8c73d70

Browse files
committed
Catch exceptions during shutdown.
Leaving this unhandled could prevent other devices in the same process (e.g. on a controller) being shut down.
1 parent 2ed26ef commit 8c73d70

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

microscope/devices.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,10 @@ def initialize(self):
253253

254254
def shutdown(self):
255255
"""Shutdown the device for a prolonged period of inactivity."""
256-
self.disable()
256+
try:
257+
self.disable()
258+
except Exception as e:
259+
_logger.debug("Exeption in disable() during shutdown: %s" % e)
257260
_logger.info("Shutting down ... ... ...")
258261
self._on_shutdown()
259262
_logger.info("... ... ... ... shut down completed.")

0 commit comments

Comments
 (0)