var r = null; Promise.resolve(1) .then(x => { throw "boom"; }) .catch(e => { r = e; }); __drain(); r