Generated client
Version: preview022, preview023
Reference error in catch body when the request throws an error does not have a callsite, and !e.isPanic. The message is not defined, which I assume should be e.message
if (callsite) {
const { stack } = printStack({
callsite,
originalMethod: clientMethod,
onUs: e.isPanic
});
const message = stack + e.message;
if (e.code) {
throw new PrismaClientKnownRequestError(this.sanitizeMessage(message), e.code, e.meta);
}
if (e instanceof PrismaClientUnknownRequestError) {
throw new PrismaClientUnknownRequestError(this.sanitizeMessage(message));
} else if (e instanceof PrismaClientInitializationError) {
throw new PrismaClientInitializationError(this.sanitizeMessage(message));
} else if (e instanceof PrismaClientRustPanicError) {
throw new PrismaClientRustPanicError(this.sanitizeMessage(message));
}
} else {
if (e.code) {
throw new PrismaClientKnownRequestError(this.sanitizeMessage(e.message), e.code, e.meta);
}
if (e.isPanic) {
throw new PrismaClientRustPanicError(e.message);
} else {
if (e instanceof PrismaClientUnknownRequestError) {
// HERE
throw new PrismaClientUnknownRequestError(this.sanitizeMessage(message));
} else if (e instanceof PrismaClientInitializationError) {
// HERE
throw new PrismaClientInitializationError(this.sanitizeMessage(message));
} else if (e instanceof PrismaClientRustPanicError) {
// HERE
throw new PrismaClientRustPanicError(this.sanitizeMessage(message));
}
}
}
@turboxx observed the same thing! So this happens in error case, right?
i am asking because we have this error on a "post-install" pipeline (it does a seed after deployment) and i am figuring out what is going wrong there.
@macrozone yes it's the catch block of the PrismaClientFetcher.request
@turboxx Can you please provide a reproduction for this?
@pantharshit00 not much to repro
you can init prisma by starter example (or any other running project with preview022, preview023). Generate client and go to node_modules/@prisma/client/index.jsgo to lines 104, 106, 108 and see that variable message is not defined, and should be e.message
Thanks a lot for reporting 馃檹
This issue is fixed in the latest alpha version of prisma2.
You can try it out with npm i -g prisma2@alpha.
In case it鈥檚 not fixed for you - please let us know and we鈥檒l reopen this issue!
Most helpful comment
@pantharshit00 not much to repro
you can init prisma by starter example (or any other running project with preview022, preview023). Generate client and go to
node_modules/@prisma/client/index.jsgo to lines 104, 106, 108 and see that variablemessageis not defined, and should bee.message