From 0a1a847044aefa312a095083691485caec8c7b0e Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 9 Dec 2022 02:06:53 -0300 Subject: [PATCH] Modif handler ScoBugCatcher pour mode dev --- app/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 4431ff691..ecbae300e 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -31,6 +31,7 @@ import sqlalchemy from app.scodoc.sco_exceptions import ( AccessDenied, ScoBugCatcher, + ScoException, ScoGenError, ScoValueError, APIInvalidParams, @@ -92,9 +93,12 @@ def handle_sco_bug(exc): """Un bug, en général rare, sur lequel les dev cherchent des informations pour le corriger. """ - Thread( - target=_async_dump, args=(current_app._get_current_object(), request.url) - ).start() + if current_app.config["TESTING"] or current_app.config["DEBUG"]: + raise ScoException # for development servers only + else: + Thread( + target=_async_dump, args=(current_app._get_current_object(), request.url) + ).start() return internal_server_error(exc)