Bradley Meck (2015-02-03T20:12:37.000Z)
d at domenic.me (2015-02-17T17:58:20.848Z)
Made a run through of using purely promises to achieve this result and it ends up with nesting and an extra try/catch which is less than stellar: ``` let fetchish = function () { return new Promise((f,r) => { // technically we need a try catch around all the functions in here to act like an async function, but lets skip some for brevity let client = new Client(); client.on('error', r); client.get().then((v) => { let body; try { body = JSON.parse(v); } catch (e) { r(e); return; } f(body); }, (e) => r(e)); }); } ``` We can track when client is in an error and keep a list of pending promises to reject, though not all promise consumers will want to reject when any error occurs, so the pure Promises solution is going to win in that case. And the cancellation token is just like a deferred? Where you pass a rejection function around outside of the promise initializer?