From ae14dfdd7fb6cff26b6d9c83b481176a40ef664e Mon Sep 17 00:00:00 2001
From: Daniel Nemergut <dnemergu@nrao.edu>
Date: Wed, 12 Jun 2024 08:53:18 -0400
Subject: [PATCH] Raising instead of returning error responses to rollback
 potentially partially committed transactions

---
 services/capability/capability/views/casa_matrix.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/services/capability/capability/views/casa_matrix.py b/services/capability/capability/views/casa_matrix.py
index f0590b2c4..91b3ad4c7 100644
--- a/services/capability/capability/views/casa_matrix.py
+++ b/services/capability/capability/views/casa_matrix.py
@@ -136,7 +136,7 @@ def add_casa_version(request: Request) -> Response:
     if added:
         return Response(status_int=http.HTTPStatus.OK, json_body=added)
     else:
-        return HTTPNotFound(detail=f"Matrix version not added")
+        raise HTTPNotFound(detail=f"Matrix version not added")
 
 
 @view_config(route_name="update_casa_version", renderer="json")
@@ -166,7 +166,7 @@ def update_casa_version(request: Request) -> Response:
     if updated:
         return Response(status_int=http.HTTPStatus.OK, json_body=updated)
     else:
-        return HTTPNotFound(detail=f"Matrix version not updated")
+        raise HTTPNotFound(detail=f"Matrix version not updated")
 
 
 @view_config(route_name="delete_casa_version", renderer="json")
-- 
GitLab