Skip to content

Release 3.1.0

Compare
Choose a tag to compare
@pburtchaell pburtchaell released this 25 Jun 23:38

The rejected parameter for a promise is now an error object. This change is not breaking.

// before
Promise.reject('foo').catch(error => {
  console.log(error instanceof Error); // => false
});

// after
Promise.reject('foo').catch(error => {
  console.log(error instanceof Error); // => true
});

// error object keys remain the same as 3.0.x
Promise.reject('foo').catch(({ reason, action }) => {
  console.log(reason); // => 'foo'
});