iopipe-js
iopipe-js copied to clipboard
errors have wrong callstack
Reported error on a lambda log uses the callstack of the iopipe catch block, instead of the call stack of the original error, ie where it was thrown from.
Error: "user code error message here"
at Report._callee$ (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:4982:62)
at tryCatch (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:2230:40)
at Generator.invoke [as _invoke] (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:2464:22)
at Generator.prototype.(anonymous function) [as next] (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:2282:21)
at step (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:1011:30)
at /opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:1029:14
at new Promise (<anonymous>)
at new F (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:143:28)
at Report.<anonymous> (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:1008:12)
at Report.prepare (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:5061:21)
at IOpipeWrapperClass._callee2$ (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:1903:36)
at tryCatch (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:2230:40)
at Generator.invoke [as _invoke] (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:2464:22)
at Generator.prototype.(anonymous function) [as next] (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:2282:21)
at step (/opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:1011:30)
at /opt/nodejs/node_modules/@iopipe/core/dist/iopipe.js:1022:13
at <anonymous>
at runMicrotasksCallback (internal/process/next_tick.js:121:5)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
Thank you for the report, @BryanCrotaz !
@BryanCrotaz Does this involve an error being supplied to context.fail? I also want to confirm if you've seen the correct error stack in your lambda logs before using context.fail. Thank you!
This is an uncaught exception that seems to be being caught by the global handler
Thanks! One more question: which version of iopipe-core are you using? (Or are you using our serverless layer?)
We've just released iopipe-js v1.17.0; can you see if this changes the behavior at all?