Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(galaxy): Produces error when user listing resolver fails validation. #2834

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading