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

.done() trims stack trace? #1020

Closed
satazor opened this Issue Feb 25, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@satazor

satazor commented Feb 25, 2016

  1. What version of bluebird is the issue happening on?
    3.3.1

  2. What platform and version? (For example Node.js 0.12 or Google Chrome 32)
    Node 4

  3. Did this issue happen with earlier version of bluebird?
    I don't know.

Running this

const Promise = require('bluebird');

Promise.reject(new Error('foo'))
.catch((err) => {
  setImmediate(() => { throw err; });
});

..prints:

$ node foo
/Users/satazor/Work/some-project/foo:5
  setImmediate(() => { throw err; });
                       ^
Error: foo
    at Object.<anonymous> (/Users/satazor/Work/some-project/foo:3:16)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3
satazor@Andres-MacBook-Pro-2

Running this

const Promise = require('bluebird');

Promise.reject(new Error('foo'))
.done()

..prints

$ node foo
Fatal Error: foo
    at Object.<anonymous> (/Users/satazor/Work/some-project/foo:8:16)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3satazor@Andres-MacBook-Pro-2

Note that the .done() version does not have a trailing \n.

@petkaantonov

This comment has been minimized.

Show comment
Hide comment
@petkaantonov

petkaantonov Feb 25, 2016

Owner

So the issue that it doesn't have a trailing \n?

Owner

petkaantonov commented Feb 25, 2016

So the issue that it doesn't have a trailing \n?

@satazor

This comment has been minimized.

Show comment
Hide comment
@satazor

satazor commented Feb 25, 2016

Correct.

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