Skip to content

1.2.0: Add async traces

Compare
Choose a tag to compare
@briancavalier briancavalier released this 15 Feb 14:00
· 27 commits to master since this release
  • Add async traces (aka "long stack traces") that track promises across thens, chains, maps, etc.
import { resolve } from '../../src/main'

resolve().then(function f1() {
  return resolve().then(function f2() {
    return resolve().then(function f3() {
      doh();  // <<< throws ReferenceError
    });
  });
});
> CREED_DEBUG=1 babel-node ./experiments/context/bb.js
/Users/brian/Projects/creed/dist/creed.js:668
        throw value;
        ^

ReferenceError: doh is not defined
    at f3 (/Users/brian/Projects/creed/experiments/context/bb.js:6:7)
 from Then:
    at f2 (/Users/brian/Projects/creed/experiments/context/bb.js:5:22)
 from Then:
    at f1 (/Users/brian/Projects/creed/experiments/context/bb.js:4:20)
 from Then:
    at Object.<anonymous> (/Users/brian/Projects/creed/experiments/context/bb.js:3:11)
    at loader (/Users/brian/Projects/creed/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/brian/Projects/creed/node_modules/babel-register/lib/node.js:154:7)