From 11fb9da32c1a02bb7f7125d1a20d359794a1e03a Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Thu, 20 Feb 2020 11:48:41 +0000 Subject: [PATCH] remove error log from dao_utils we don't need it here - as exceptions are re-raised, they will be logged additionally by error handlers further up. All this exception logger tells us is that service names are already in use, which isn't something we're really interested in. --- app/dao/dao_utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/dao/dao_utils.py b/app/dao/dao_utils.py index fa038b55c..d8a273ccf 100644 --- a/app/dao/dao_utils.py +++ b/app/dao/dao_utils.py @@ -8,13 +8,11 @@ from app.history_meta import create_history def transactional(func): @wraps(func) def commit_or_rollback(*args, **kwargs): - from flask import current_app try: res = func(*args, **kwargs) db.session.commit() return res - except Exception as e: - current_app.logger.error(e) + except Exception: db.session.rollback() raise return commit_or_rollback