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

Raw queries exception error message do not include "code snippet" #10230

Open
janpio opened this issue Nov 12, 2021 · 2 comments
Open

Raw queries exception error message do not include "code snippet" #10230

janpio opened this issue Nov 12, 2021 · 2 comments
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/typescript Issue for tech TypeScript. topic: raw $queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli

Comments

@janpio
Copy link
Member

janpio commented Nov 12, 2021

Compare these error messages for prisma.$queryRaw and prisma.user.findMany():

C:\Users\Jan\Documents\throwaway\10141>node script.js
PrismaClientInitializationError: 
Invalid `prisma.user.findMany()` invocation in
C:\Users\Jan\Documents\throwaway\10141\script.js:8:36

   5 async function main() {
   6
   7   try {
→  8     const data = await prisma.user.findMany(
  Can't reach database server at `example.org`:`123`

Please make sure your database server is running at `example.org`:`123`.
    at cb (C:\Users\Jan\Documents\throwaway\10141\node_modules\@prisma\client\runtime\index.js:38508:17)
    at async main (C:\Users\Jan\Documents\throwaway\10141\script.js:8:18) {
  clientVersion: '3.4.2',
  errorCode: undefined
}

and

C:\Users\Jan\Documents\throwaway\10141>node script.js
PrismaClientInitializationError: 
Invalid `prisma.queryRaw()` invocation:


  Can't reach database server at `example.org`:`123`

Please make sure your database server is running at `example.org`:`123`.
    at cb (C:\Users\Jan\Documents\throwaway\10141\node_modules\@prisma\client\runtime\index.js:38508:17)
    at async main (C:\Users\Jan\Documents\throwaway\10141\script.js:8:18) {
  clientVersion: '3.4.2',
  errorCode: undefined
}

Note how the raw error does not include the "code snippet".

(The missing errorCode is reported in #10229)

@janpio janpio added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: raw $queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli team/client Issue for team Client. bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. and removed bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. labels Nov 12, 2021
@janpio janpio added the tech/typescript Issue for tech TypeScript. label Mar 31, 2022
@janpio
Copy link
Member Author

janpio commented Sep 16, 2022

(Might already have been fixed by a recent PR from @SevInf)

@millsp
Copy link
Member

millsp commented Aug 24, 2023

This is still the case, the stacktrace information for raw queries has no useful information because it is obstructed by the proxies we use for prisma.<model>.<method>.

@millsp millsp added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/typescript Issue for tech TypeScript. topic: raw $queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli
Projects
None yet
Development

No branches or pull requests

2 participants