🥅 Better error handling for systeminfo bundle additions

This commit is contained in:
Gina Häußge committed 2023-03-02 17:44:59 +01:00
1 parent 24677639f2
commit 8f6ba79a86
1 file changed
+8 -4
+8 -4
View File
@@ -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},
)