From 6745a5a1f998d1ab3ef82665023894cb1b0977e3 Mon Sep 17 00:00:00 2001 From: Dominik Haentsch Date: Wed, 14 Feb 2024 13:45:23 +0100 Subject: [PATCH] add missing newline to event details --- renumics/spotlight/reporting.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/renumics/spotlight/reporting.py b/renumics/spotlight/reporting.py index 2fd4207c..e2165528 100644 --- a/renumics/spotlight/reporting.py +++ b/renumics/spotlight/reporting.py @@ -19,6 +19,7 @@ from loguru import logger from renumics.spotlight import __version__ +from renumics.spotlight.data_source import DataSource from renumics.spotlight.plugin_loader import load_plugins from renumics.spotlight.settings import settings @@ -190,7 +191,9 @@ def _sanitize_traceback_exception(exc: traceback.TracebackException) -> None: _sanitize_traceback_exception(exc.__context__) -def emit_exception_event(path: Optional[str] = None) -> None: +def emit_exception_event( + path: Optional[str] = None, datasource: Optional[DataSource] = None +) -> None: """ Emit an exception event. """ @@ -200,10 +203,9 @@ def emit_exception_event(path: Optional[str] = None) -> None: traceback_exc = traceback.TracebackException.from_exception(exc) _sanitize_traceback_exception(traceback_exc) - if path: - detail = f"Path: {path}\n" + "\n\n".join(traceback_exc.format()) - else: - detail = "Path: None\n" + "\n\n".join(traceback_exc.format()) + detail = f"Path: {path}\nDatasource: {type(datasource).__name__}\n" + "\n\n".join( + traceback_exc.format() + ) report_event( {