feat(CordovaError): support for error cause & more (#121)
This commit bases CordovaError on the popular [joyent/node-verror].
We actually use @netflix/nerror, a VError fork, for now. That's because
we do not want printf style error formatting support and that fork
allows to disable it. There's [ongoing work][1] to integrate that change
into the original VError.
So basically CordovaError behaves like PError but with all the static
methods from VError and different parameter ordering for its
constructor.
One change that could break some existing tests in repositories that use
cordova-common is that `toString` (for errors without a cause argument)
now behaves like the Error default again:
new CordovaError('foo').toString();
// old result: 'foo'
// new result: 'CordovaError: foo'
[joyent/node-verror]: https://github.com/joyent/node-verror
[1]: https://github.com/joyent/node-verror/issues/63#issuecomment-
546067267