diff --git a/superxas_bec/devices/timepix/timepix.py b/superxas_bec/devices/timepix/timepix.py index be5d493..b07ab66 100644 --- a/superxas_bec/devices/timepix/timepix.py +++ b/superxas_bec/devices/timepix/timepix.py @@ -7,6 +7,7 @@ is implemented via EPICS IOC. import enum import threading import time +import traceback from typing import Any, Literal import numpy as np @@ -476,8 +477,8 @@ if __name__ == "__main__": # pragma: no cover timepix.unstage() print("Timepix unstaged.") except Exception as e: - print(f"An error occurred: {e}") - logger.error(f"An error occurred: {e}") + content = traceback.format_exc() + logger.error(f"An error occurred: {content}") finally: timepix.destroy() print("Timepix destroyed.")