You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an easy way to get to the raw stack trace with longjohn? I have a generic exception handler that when called performs a new Error() to get to the trace. It would be nice if it didn't report itself in the results. Also as I'm recording these to a MongoDB I would rather write the JSONified trace than the stringified trace.
It would be even better if longjohn had some type of currentStack instead of having to do a new Error every time you need the trace details.
Even a starting point on what to modify/change would be great. I'd gladly do the pull request.
Thanks,
Jeremy
The text was updated successfully, but these errors were encountered:
This is an unfortunate suggestion, but try using https://github.com/felixge/node-stack-trace in order to parse the stack trace for now. I was trying to figure out a way to expose both the raw trace and the stringified trace through the same error object but have yet to figure out a good way to do this. The basic issue is that adding a property to the error object that gets returned out seemed to not be possible in the way that I did things. In essence, the prepareStackTrace method can only be called once for any error. You could take a look in there and see if you can get the raw stack attached to the error that gets returned out.
Also, if you'd like something like currentStack, you could use visionmedia's https://github.com/visionmedia/callsite to get a stacktrace. He had another lib that does exactly what you want based on callsite, but I forget what it is now.
Is there an easy way to get to the raw stack trace with longjohn? I have a generic exception handler that when called performs a new Error() to get to the trace. It would be nice if it didn't report itself in the results. Also as I'm recording these to a MongoDB I would rather write the JSONified trace than the stringified trace.
It would be even better if longjohn had some type of currentStack instead of having to do a new Error every time you need the trace details.
Even a starting point on what to modify/change would be great. I'd gladly do the pull request.
Thanks,
The text was updated successfully, but these errors were encountered: