Skip to content

Commit

Permalink
Use console.error for Prisma errors (#8722)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Cousens <dcousens@users.noreply.github.com>
  • Loading branch information
dcousens and dcousens committed Apr 4, 2024
1 parent 6013b69 commit b0961ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/more-errors-please.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': minor
---

`KS_PRISMA_ERRORS` are now logged with `console.error` on the server
2 changes: 2 additions & 0 deletions packages/core/src/lib/createSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ function injectNewDefaults (prismaClient: unknown, lists: Record<string, Initial
try {
return await query(args)
} catch (e: any) {
console.error(e)

if ((e as any).code === undefined) {
return new GraphQLError(`Prisma error`, {
extensions: {
Expand Down

0 comments on commit b0961ce

Please sign in to comment.