From da4d3269c673dfb943c944581045bd37f6fd4bd2 Mon Sep 17 00:00:00 2001 From: Jose Borreguero Date: Thu, 4 Aug 2022 07:59:04 -0400 Subject: [PATCH] print the exception into the popup when in DEBUG mode Signed-off-by: Jose Borreguero --- src/fitting/view_util.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fitting/view_util.py b/src/fitting/view_util.py index add765c..1b749ef 100644 --- a/src/fitting/view_util.py +++ b/src/fitting/view_util.py @@ -1024,9 +1024,10 @@ def parse_ascii_file(request, file_name, raw_content): # Upload plot to live data server return data_handler.store_user_data(request, file_name, plot) - except: # noqa: E722 - logging.exception(f'Could not parse file "{file_name}"') - return False, f"Could not parse data file {file_name}" + except Exception as e: # noqa: E722 + info_debug = f"\n{e}" if settings.DEBUG else "" + logging.exception(f'Could not parse file "{file_name}"' + info_debug) + return False, f'Could not parse data file "{file_name}"' + info_debug def get_user_files(request): -- GitLab