Socket
Socket
Sign inDemoInstall

verror

Package Overview
Dependencies
1
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.2 to 1.3.3

1

examples/werror.js

@@ -12,3 +12,4 @@ var mod_fs = require('fs');

console.log(err3.message);
console.log(err3.toString());
console.log(err3.stack);
});

4

lib/verror.js

@@ -148,8 +148,6 @@ /*

{
if (c instanceof Error) {
if (c instanceof Error)
this.we_cause = c;
this.stack += '\nCaused by: ' + c.stack;
}
return (this.we_cause);
};
{
"name": "verror",
"version": "1.3.2",
"version": "1.3.3",
"description": "richer JavaScript errors",

@@ -5,0 +5,0 @@ "main": "./lib/verror.js",

@@ -99,4 +99,5 @@ # verror: richer JavaScript errors

printf-style arguments and an optional cause), but the resulting "message" only
contains the top-level error. Using the same example above, but replacing the
VError in handleRequest with WError, we get this output:
contains the top-level error. It's also more verbose, including the class
associated with each error in the cause chain. Using the same example above,
but replacing the VError in handleRequest with WError, we get this output:

@@ -108,16 +109,5 @@ request failed

WError: request failed; caused by failed to check "/nonexistent": ENOENT,
stat '/nonexistent'
WError: request failed; caused by WError: failed to check "/nonexistent";
caused by Error: ENOENT, stat '/nonexistent'
and as usual, the "stack" member shows the stack trace:
WError: failed to handle request; caused by WError: failed to stat "/nonexistent"; caused by Error: ENOENT, stat '/nonexistent'
at /Users/dap/work/node-verror/examples/werror.js:10:13
at Object.oncomplete (fs.js:297:15)
Caused by: WError: failed to stat "/nonexistent"; caused by Error: ENOENT, stat '/nonexistent'
at /Users/dap/work/node-verror/examples/werror.js:7:20
at Object.oncomplete (fs.js:297:15)
Caused by: Error: ENOENT, stat '/nonexistent'
# Contributing

@@ -124,0 +114,0 @@

@@ -98,4 +98,2 @@ /*

'WError: proximate cause: 3 issues; caused by Error: root cause',
' at Object.<anonymous> (tst.werror.js)\n' + nodestack,
'Caused by: Error: root cause',
' at Object.<anonymous> (tst.werror.js)'

@@ -112,4 +110,2 @@ ].join('\n') + '\n' + nodestack);

'WError: proximate cause: 3 issues; caused by Error: root cause',
' at Object.<anonymous> (tst.werror.js)\n' + nodestack,
'Caused by: Error: root cause',
' at Object.<anonymous> (tst.werror.js)'

@@ -116,0 +112,0 @@ ].join('\n') + '\n' + nodestack);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc