Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long stack traces #2

Open
floatdrop opened this issue Nov 2, 2014 · 3 comments
Open

Long stack traces #2

floatdrop opened this issue Nov 2, 2014 · 3 comments

Comments

@floatdrop
Copy link

When using stackman with long stacktraces it gives empty frames:

{ properties: {}, frames: [] }
var Promise = require('bluebird');
var stackman = require('stackman')();

Promise.longStackTraces();
Promise.resolve().then(function outer() {
    return Promise.resolve().then(function inner() {
        return Promise.resolve().then(function evenMoreInner() {
            a.b.c.d()
        }).catch(function catcher(e) {
            stackman(e, function (stack) {
                console.log(stack);
            });
        });
    });
});
@watson
Copy link
Owner

watson commented Nov 3, 2014

@floatdrop Interesting... Thanks for the bug report :) I'll look into it

@floatdrop
Copy link
Author

@watson I just realized, that example was wrong - var stackman = require('stackman')(); should come after bluebird require, but result is same (fixed example in topic).

@watson
Copy link
Owner

watson commented Jan 19, 2015

I've been working on different ways of getting around this issue, but so far haven't found a good solution. The issue is that the error catcher in bluebird get's a hold of and manipulates the error object before it passes it to the catcher function. At that point the stack trace is already generated and stackman and lost the window in which to get access to it.

I currently do not recommend running with any form of long stack trace system in production anyway since it decreases performance (which is also the recommendation by the bluebird module).

Until there is a stable solution for having multiple modules attempting to hook in to the V8 stack trace engine this is not something that can be supported. I would love to hear if anybody else have found a way around this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants