From ca2fcbbad0714e6c67192b1bd0e2ab7375680c85 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 6 Feb 2026 17:09:32 -0600 Subject: Use AuthorisationError to indicate error condition. --- gn_auth/auth/authorisation/data/phenotypes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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] -- cgit 1.4.1