I'm not sure of serverless environment support for Error.captureStackTrace, since this is not a web standard, per se. However, it does exist for Cloudflare Workers. That's why there's a conditional check for Error.captureStackTrace.
I'm willing to pick this up in a PR if you all are open to it!! Would be more than happy to contribute.
Steps to reproduce
neon
that will return aNeonDbError
error
error.stack
(anderror.sourceError.stack
if you're so inclined)Expected result
The
NeonDbError
should include a stack trace whenever possibleActual result
Instances of
NeonDbError
do not include a stack traceEnvironment
Cloudflare workers (but also everywhere)
Logs, links
The stack trace of an error is helpful for error monitoring tools, to be able to link back to the line of code that triggered the error.
As of writing,
NeonDbError
does indeed inherit fromError
, but it does not include a stack trace, asError
usually does.This would be possible to implement with a quick code change, adding a constructor to the custom
NeonDbError
class:I'm not sure of serverless environment support for
Error.captureStackTrace
, since this is not a web standard, per se. However, it does exist for Cloudflare Workers. That's why there's a conditional check forError.captureStackTrace
.I'm willing to pick this up in a PR if you all are open to it!! Would be more than happy to contribute.