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

Cannot set property stack of [Error (E_UNKNOWN) Encountered an unexpected error] which has only a getter #552

Closed
tjwebb opened this Issue Mar 29, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@tjwebb

tjwebb commented Mar 29, 2015

I get this on an unhandled error on bluebird. Node 0.10.32 (tried also on 0.11, 0.12, and io 1.6), bluebird 2.9 (also tried on 2.6). Any ideas?

node_modules/bluebird/js/main/captured_trace.js:54
        error.stack = stack.join("\n");

TypeError: Cannot set property stack of [Error (E_UNKNOWN) Encountered an unexpected error]  which has only a getter
@petkaantonov

This comment has been minimized.

Show comment
Hide comment
@petkaantonov

petkaantonov Mar 30, 2015

Owner

Waterline's WLError doesn't allow setting .stack, it only defines a getter not a setter

Owner

petkaantonov commented Mar 30, 2015

Waterline's WLError doesn't allow setting .stack, it only defines a getter not a setter

@tjwebb

This comment has been minimized.

Show comment
Hide comment
@tjwebb

tjwebb Mar 30, 2015

I think you know more about how this works than I do. How is it that a property becomes un-settable?

tjwebb commented Mar 30, 2015

I think you know more about how this works than I do. How is it that a property becomes un-settable?

@petkaantonov

This comment has been minimized.

Show comment
Hide comment
@petkaantonov

petkaantonov Mar 30, 2015

Owner

Waterline does something like this:

"use strict";
function WLError() {}

WLError.prototype.__defineGetter__("stack", function() {
    return "...";
});

var e = new WLError();
e.stack = "..."; // Throws an error because there is no setter
Owner

petkaantonov commented Mar 30, 2015

Waterline does something like this:

"use strict";
function WLError() {}

WLError.prototype.__defineGetter__("stack", function() {
    return "...";
});

var e = new WLError();
e.stack = "..."; // Throws an error because there is no setter
@tjwebb

This comment has been minimized.

Show comment
Hide comment
@tjwebb

tjwebb commented Mar 30, 2015

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment