frappy.client.interactive: fix error handling while interrupted

Change-Id: If79ebe322eb865fd0780622fdd357c092bf12216
This commit is contained in:
2026-05-18 09:38:19 +02:00
parent a0e250d638
commit 0decbf52d2
+5 -2
View File
@@ -242,16 +242,19 @@ class Module:
loop()
except KeyboardInterrupt:
self._secnode.log.info('-- interrupted --')
exc = None
try:
self.stop()
except Exception as e:
print(f'while stopping: {e!r}')
exc = e
try:
loop() # wait for stopping to be finished
except KeyboardInterrupt:
# interrupted again while stopping -> definitely quit
pass
clientenv.raise_with_short_traceback(e)
if exc:
print(f'while stopping: {e!r}')
clientenv.raise_with_short_traceback(exc)
finally:
self._secnode.readParameter(self._name, 'value')
for pname in watch_params: