Skip to content

Commit

Permalink
Make sure prisma error code isn't lost (#6484)
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie authored Sep 7, 2021
1 parent 1659e1f commit e2a336c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/keystone/src/lib/core/graphql-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const prismaError = (err: Error) => {
return new ApolloError(
`Prisma error: ${err.message.split('\n').slice(-1)[0].trim()}`,
'INTERNAL_SERVER_ERROR',
{ ...err }
{ prisma: { ...err } }
);
};

Expand Down
5 changes: 2 additions & 3 deletions tests/api-tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ export const expectPrismaError = (
args.map(({ path, message, code, target }) => ({
extensions: {
code: 'INTERNAL_SERVER_ERROR',
exception: { clientVersion: '2.30.2', code, meta: { target } },
meta: { target },
clientVersion: '2.30.2',
exception: { prisma: { clientVersion: '2.30.2', code, meta: { target } } },
prisma: { clientVersion: '2.30.2', code, meta: { target } },
},
path,
message,
Expand Down

0 comments on commit e2a336c

Please sign in to comment.