Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 1, 2024 via pnpm

verror 1.3.4

richer JavaScript errors
Package summary
Share
2
issues
2
critical severity
license
2
1
license
2
N/A
Package created
18 Apr 2012
Version published
17 Oct 2012
Maintainers
10
Total deps
2
Direct deps
1
License
UNKNOWN

Issues

2

2 critical severity issues

critical
Recommendation: Check the package code and files for license information
via: extsprintf@1.0.0
Recommendation: Check the package code and files for license information
via: verror@1.3.4
Collapse
Expand

Licenses

N/A

N/A
2 Packages, Including:
extsprintf@1.0.0
verror@1.3.4
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
ⓘ This is a list of verror 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
extsprintf1.0.08.94 kBUNKNOWN
prod
1

Visualizations

Frequently Asked Questions

What does verror do?

Verror is a Node.js library that enhances and enriches the capability of JavaScript in handling errors. This library offers various classes that support printf-style arguments for easier message readability, chains of causes that enable tracking of errors from initial point to the final error point, extra properties to supply more information about the error, and the creation of personalized subclasses that come with full support.

How do you use verror?

To use verror, first, install the package using npm:

npm install verror

Verror can be used as a replacement for JavaScript Error class. It offers additional features such as printf-style messages:

var VError = require('verror');
var err = new VError('missing file: "%s"', '/etc/passwd');
console.log(err.message);

It also supports chaining of errors while maintaining each error’s message:

var VError = require('verror');
var fs = require('fs');
var filename = '/nonexistent';
fs.stat(filename, function (err1) {
	var err2 = new VError(err1, 'stat "%s"', filename);
	console.error(err2.message);
});

You can get the next-level error using err.cause():

console.error(err2.cause().message);

Chaining of errors can be done as many times you want:

var err1 = new Error('No such file or directory');
var err2 = new VError(err1, 'failed to stat "%s"', '/junk');
var err3 = new VError(err2, 'request failed');
console.error(err3.message);

This will print: request failed: failed to stat "/junk": No such file or directory

Where are the verror docs?

The official documentation for Verror can be found in the readme of the repository: https://github.com/joyent/node-verror. The readme contains comprehensive information on how to use the library, constructors, properties and methods of the VError, WError, SError, and MultiError classes, as well as practical examples of how to use them.