iopipe-js icon indicating copy to clipboard operation
iopipe-js copied to clipboard

errors have wrong callstack

Open BryanCrotaz opened this issue 5 years ago • 5 comments

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)

BryanCrotaz avatar Sep 27 '19 10:09 BryanCrotaz

Thank you for the report, @BryanCrotaz !

mrickard avatar Sep 27 '19 13:09 mrickard

@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!

mrickard avatar Sep 27 '19 14:09 mrickard

This is an uncaught exception that seems to be being caught by the global handler

BryanCrotaz avatar Sep 27 '19 14:09 BryanCrotaz

Thanks! One more question: which version of iopipe-core are you using? (Or are you using our serverless layer?)

mrickard avatar Sep 27 '19 16:09 mrickard

We've just released iopipe-js v1.17.0; can you see if this changes the behavior at all?

mrickard avatar Sep 27 '19 17:09 mrickard