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

bluebird unhappy with non-writable 'stack' property #9

Closed
mvayngrib opened this issue Jun 4, 2018 · 3 comments · Fixed by #10
Closed

bluebird unhappy with non-writable 'stack' property #9

mvayngrib opened this issue Jun 4, 2018 · 3 comments · Fixed by #10

Comments

@mvayngrib
Copy link

it annoys the bluebird promise library, which complains about promises being rejected with non-errors :)

const ex = require('error-ex')

// from bluebird
const isPropertyWritable = (obj, prop) => {
  var descriptor = Object.getOwnPropertyDescriptor(obj, prop);
  return !!(!descriptor || descriptor.writable || descriptor.set);
}


const CustomError = ex('CustomErr')

console.log(isPropertyWritable(new Error('hey'), 'stack'))
console.log(isPropertyWritable(new CustomError('ho'), 'stack'))
@mvayngrib mvayngrib changed the title native Error's property 'stack' is writable, error-ex's is not bluebird unhappy with non-writable 'stack' property Jun 4, 2018
@mvayngrib
Copy link
Author

@Qix- hm, after reviewing #6, i'm not sure this is actually solveable, while preserving your dynamic stack traces

Qix- added a commit that referenced this issue Jun 12, 2018
Qix- added a commit that referenced this issue Jun 12, 2018
@Qix-
Copy link
Owner

Qix- commented Jun 12, 2018

i'm not sure this is actually solveable, while preserving your dynamic stack traces

It is :) I just check to see if we've overridden the original stack since we (luckily) acquire it each time anyway.

@Qix- Qix- closed this as completed in #10 Jun 19, 2018
@Qix-
Copy link
Owner

Qix- commented Jun 19, 2018

Fix published as 1.3.2. Thanks again!

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

Successfully merging a pull request may close this issue.

2 participants