Skip to content

Commit 0592368

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 c808d0d commit 0592368

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
@@ -256,7 +256,10 @@ def initialize(self):
256256

257257
def shutdown(self):
258258
"""Shutdown the device for a prolonged period of inactivity."""
259-
self.disable()
259+
try:
260+
self.disable()
261+
except Exception as e:
262+
_logger.debug("Exeption in disable() during shutdown: %s" % e)
260263
_logger.info("Shutting down ... ... ...")
261264
self._on_shutdown()
262265
_logger.info("... ... ... ... shut down completed.")

0 commit comments

Comments
 (0)