Generalize caught exceptions on workflow delete

OsloDB sometimes does not convert the underlying SQLAlchemy
errors into DBError. Sometimes it happens that the "too deep
cascade delete" error manifests in sa.OperationalError instead
of DBError. We generalize to catch both cases as the underlying
issue is the same (just as the message of the error).

Change-Id: Icce8dfa6edb18973ca2a4eb594818ea9d504b49a
This commit is contained in:
Andras Kovi 2020-07-21 09:36:48 +02:00 committed by Andras Kovi
parent 703261c6ae
commit 2e600ce6fc
1 changed files with 1 additions and 1 deletions

View File

@ -916,7 +916,7 @@ def delete_workflow_execution(id, session=None):
raise exc.DBEntityNotFoundError(
"WorkflowExecution not found [id=%s]" % id
)
except db_exc.DBError as e:
except Exception as e:
if is_mysql_max_depth_error(e) or is_mariadb_max_depth_error(e):
# https://bugs.launchpad.net/mistral/+bug/1832300
# mysql cascade delete error