Skip to content

Commit 588217b

Browse files
committed
exception handling for ngx lock release
1 parent 096ea7b commit 588217b

File tree

1 file changed

+9
-2
lines changed
  • pychron/spectrometer/isotopx/spectrometer

1 file changed

+9
-2
lines changed

pychron/spectrometer/isotopx/spectrometer/ngx.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,16 @@ def read_intensities(
292292
self.debug("keys: {}".format(keys))
293293
self.debug("signals: {}".format(signals))
294294

295-
self.microcontroller.lock.release()
296-
if trigger_release:
295+
try:
297296
self.microcontroller.lock.release()
297+
except RuntimeError as e:
298+
self.debug(f'Cannot release lock. "RuntimeError" {e}')
299+
300+
if trigger_release:
301+
try:
302+
self.microcontroller.lock.release()
303+
except RuntimeError as e:
304+
self.debug(f'Trigger Release. Cannot release lock. "RuntimeError" {e}')
298305

299306
return keys, signals, collection_time, inc
300307

0 commit comments

Comments
 (0)