about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2026-02-06 17:09:32 -0600
committerFrederick Muriuki Muriithi2026-02-06 17:09:32 -0600
commitca2fcbbad0714e6c67192b1bd0e2ab7375680c85 (patch)
treed5f0597cfd53c4510ffc558ed3d061d4cc1b4b39
parent6f1907292cb2b54b8f18b139480b1837c6f355e0 (diff)
downloadgn-auth-main.tar.gz
Use AuthorisationError to indicate error condition. HEAD main
-rw-r--r--gn_auth/auth/authorisation/data/phenotypes.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gn_auth/auth/authorisation/data/phenotypes.py b/gn_auth/auth/authorisation/data/phenotypes.py
index 20f887c..1f79e0e 100644
--- a/gn_auth/auth/authorisation/data/phenotypes.py
+++ b/gn_auth/auth/authorisation/data/phenotypes.py
@@ -221,7 +221,8 @@ def fetch_resource_id(cursor: authdb.DbCursor,
         tuple(str(_id) for _id in data_link_ids))
     _ids = tuple(uuid.UUID(row['resource_id']) for row in cursor.fetchall())
     if len(_ids) != 1:
-        raise InvalidResourceError("...")
+        raise AuthorisationError(
+            f"Expected data from 1 resource, got {len(_ids)} resources.")
     return _ids[0]