I was seeing some issues around not getting stack ...
# orm-help
a
I was seeing some issues around not getting stack traces logged properly when a PrismaClientInitializationError was thrown (I expected the error, because my local database hadn’t been started). I noticed in the source for this Error that I don’t think it is being constructed properly: source:
Copy code
constructor(message: string, clientVersion: string, errorCode?: string) {
    super(message)
    this.clientVersion = clientVersion
    this.errorCode = errorCode
    Error.captureStackTrace(PrismaClientInitializationError)
  }
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#custom_error_typeshttps://nodejs.org/dist/latest-v16.x/docs/api/errors.html#errorcapturestacktracetargetobject-constructoropt what I believe is correct:
Copy code
constructor(message: string, clientVersion: string, errorCode?: string) {
    super(message)
    this.clientVersion = clientVersion
    this.errorCode = errorCode
    Error.captureStackTrace(this, PrismaClientInitializationError)
  }
I am up for contributing a PR, but first I am curious if there was an intentional design around capturing the stack trace in this manner.
1
n
Hi @Andy Pickler 👋 Welcome to our Slack Community! prisma rainbow Our Engineering team would be able to provide inputs on if this was an intentional design for capturing the stack trace. The best approach would be to create a GitHub Issue and report your investigation there, our engineering team monitors the issues and triages it regularly, so they will be able to get back to you and also guide in case a PR could be opened.
a
Roger…will do that
🙏 2
v
Thank you, @Andy Pickler! 💯
Once you open the GH could you please share the link so that we can track it on our end as well? I would be very curious to learn a bit more about your use case - is this a personal / work project, in prod / development, etc.
a
This is a work project for a new product we are bringing to market very soon. Full TypeScript stack…NextJS on the front-end, NestJS + Apollo GraphQL + Prisma on the back-end
v
Thank you for the additional information and for opening that GH Issue, @Andy Pickler! It's awesome to hear you're investigating using Prisma for a new product and you've brought us an interesting pain point. If you have time, our Product Team would be very interested in jumping on a quick call to understand a bit more about your use case. Feel free to select a time that works for you here: 😊 https://calendly.com/d/dxt-c8n-2gh/prisma-product-team-user-interview In the meantime, we'll investigate the GH issue for you!
a
Thanks…am setting up an appointment now
🙌 2
💯 2
v
Thank you!