Skip to content

Commit

Permalink
fix(galaxy): Produces error when user listing resolver fails validati…
Browse files Browse the repository at this point in the history
…on. (#2834)
  • Loading branch information
betimshahini authored Feb 5, 2024
1 parent ab8d410 commit 6e11422
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions platform/galaxy/src/schema/resolvers/authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
ApplicationURNSpace,
} from '@proofzero/urns/application'
import * as jose from 'jose'
import { BadRequestError } from '@proofzero/errors'

const authorizationResolvers: Resolvers = {
Query: {
Expand Down Expand Up @@ -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 {
Expand All @@ -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 =
Expand Down

0 comments on commit 6e11422

Please sign in to comment.