Skip to content

Failures get swallowed and lost. #74

@johnjbarton

Description

@johnjbarton

When I debug the example below I see that wrap() swallows the exception even in the case that no rejection handlers are registered. This is not a good thing: consider that the function that throws here could be many libraries away and know nothing about Promises.

var testResult = (function () {
  var p = new Promise(function(r) {
    setTimeout(function() {
      r.resolve();
    }, 10);
  });
  p.then(function() {
    throw new Error('blam');
  });
  return p;
})();
testResult.then(function(value) {
  console.log("success");
}, function(error) {
  console.error(error);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions