Modif handler ScoBugCatcher pour mode dev

This commit is contained in:
Emmanuel Viennet 2022-12-09 02:06:53 -03:00
parent 20e3554cdf
commit 409ad75096
1 changed files with 7 additions and 3 deletions

View File

@ -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)