JS DevTools Ono Versions Save

Wrap errors without losing the original message, stack trace, or properties

v2.0.0

8 years ago

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