Skip to content

Releases: JS-DevTools/ono

v2.0.0

14 Dec 19:53
Compare
Choose a tag to compare

Bumping the major version number, since this release includes a potentially breaking change. In previous versions, when using ono to wrap an existing Error, it would copy the original error's message and stack trace. In this version, it now copies the original error's properties as well.

The same behavior could be achieved in previous versions of ono by also passing the original error as the second parameter. For example:

try {
  ...
}
catch (e) {
  // It is no longer necessary to pass the original error twice
  throw ono(e, e, 'New error message');
}