From e953ccac800d3ed6764f2a94d86c58b4769d1734 Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 1 Aug 2023 14:20:42 +0100 Subject: [PATCH] Another small logging fix --- vxlogging.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vxlogging.py b/vxlogging.py index 6fd5631..36590c4 100644 --- a/vxlogging.py +++ b/vxlogging.py @@ -39,6 +39,9 @@ def debug(message): def get_exception_traceback_str(exc: Exception) -> str: # Ref: https://stackoverflow.com/a/76584117/ - file = StringIO() - traceback.print_exception(exc, file=file) - return file.getvalue().rstrip() \ No newline at end of file + try: + file = StringIO() + traceback.print_exception(exc, file=file) + return file.getvalue().rstrip() + except: + return str(exc) \ No newline at end of file