fix: restore ValueError handling in WorkflowByIdApi for improved error reporting

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN- 2025-03-04 14:36:27 +08:00
parent 5e7890f36f
commit c9e455ad14
No known key found for this signature in database
GPG Key ID: 6BA0D108DED011FF

View File

@ -602,12 +602,12 @@ class WorkflowByIdApi(Resource):
)
# Commit the transaction in the controller
session.commit()
except ValueError as e:
raise NotFound(str(e))
except WorkflowInUseError as e:
abort(400, description=str(e))
except DraftWorkflowDeletionError as e:
abort(400, description=str(e))
except ValueError as e:
raise NotFound(str(e))
return None, 204