From 65e6e22e2d554390f605548e19d1d8e230b7e0e3 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Mon, 20 Apr 2026 12:05:41 +0200 Subject: [PATCH] Exceptions: added an UnmountingFailed exception --- src/aare/common/exception_handler.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/aare/common/exception_handler.py b/src/aare/common/exception_handler.py index 08abf5bd..e786cc83 100644 --- a/src/aare/common/exception_handler.py +++ b/src/aare/common/exception_handler.py @@ -27,6 +27,16 @@ class LoopCenteringFailed(Exception): return self.message +class UnmountingFailed(Exception): + def __init__(self, message: str = "A sample was not unmounted"): + super().__init__(message) + self.message = message + logger.error(message, extra={"exception:": Exception}) + + def __str__(self) -> str: + return self.message + + class MountingFailed(Exception): def __init__(self, message: str = "A sample was not mounted"): super().__init__(message)