From 6e11422493fcb5dba64e64a62dd015f973ab9cb9 Mon Sep 17 00:00:00 2001 From: betimshahini Date: Mon, 5 Feb 2024 15:36:04 -0500 Subject: [PATCH] fix(galaxy): Produces error when user listing resolver fails validation. (#2834) --- .../galaxy/src/schema/resolvers/authorization.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/platform/galaxy/src/schema/resolvers/authorization.ts b/platform/galaxy/src/schema/resolvers/authorization.ts index ca220fcef8..4df7610274 100644 --- a/platform/galaxy/src/schema/resolvers/authorization.ts +++ b/platform/galaxy/src/schema/resolvers/authorization.ts @@ -19,6 +19,7 @@ import { ApplicationURNSpace, } from '@proofzero/urns/application' import * as jose from 'jose' +import { BadRequestError } from '@proofzero/errors' const authorizationResolvers: Resolvers = { Query: { @@ -56,9 +57,10 @@ const authorizationResolvers: Resolvers = { limit > 50 || limit < 1 ) - throw new GraphQLError( - 'Limit and offset numbers need to be provided, with the limit beging between 1 and 50' - ) + throw new BadRequestError({ + message: + 'Limit and offset numbers need to be provided, with the limit beging between 1 and 50', + }) let clientIdFromApiKey try { @@ -68,7 +70,9 @@ const authorizationResolvers: Resolvers = { ApplicationURNSpace.nss(apiKeyApplicationURN).split('/')[1] } catch (e) { console.error('Error parsing clientId', e) - throw new GraphQLError('Could not retrieve clientId from API key.') + throw new BadRequestError({ + message: 'Could not retrieve clientId from API key.', + }) } const edgeResults =