Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@JamesMessinger JamesMessinger released this 14 Dec 19:53
· 341 commits to master since this release

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');
}