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

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

@tjwebb
Copy link

@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
Copy link
Owner

@petkaantonov petkaantonov commented Mar 30, 2015

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

@tjwebb
Copy link
Author

@tjwebb 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
Copy link
Owner

@petkaantonov 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
Copy link
Author

@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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants