From 8f6ba79a863d212fbef8e834cf7bbba1472d252b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 2 Mar 2023 17:44:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Better=20error=20handling=20for?= =?UTF-8?q?=20systeminfo=20bundle=20additions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/cli/systeminfo.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/octoprint/cli/systeminfo.py b/src/octoprint/cli/systeminfo.py index 0c33273d4..e8c4eca8a 100644 --- a/src/octoprint/cli/systeminfo.py +++ b/src/octoprint/cli/systeminfo.py @@ -119,12 +119,16 @@ def get_systeminfo_bundle(systeminfo, logbase, printer=None, plugin_manager=None z.add_path(content, arcname=log) elif callable(content): # content generating callable - z.add(to_bytes(content()), arcname=log) + try: + z.add(to_bytes(content()), arcname=log) + except Exception: + logging.getLogger(__name__).exception( + f"Error while executing callable for additional bundle content {log} for plugin {name}", + extra={"plugin": name}, + ) except Exception: logging.getLogger(__name__).exception( - "Error while retrieving additional bundle contents for plugin {}".format( - name - ), + f"Error while retrieving additional bundle contents for plugin {name}", extra={"plugin": name}, )