{"_id":"verror","_rev":"68-558be5d51ee01425310f343e97fb09b7","name":"verror","description":"richer JavaScript errors","dist-tags":{"latest":"1.6.0"},"versions":{"1.0.0":{"name":"verror","version":"1.0.0","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.0"},"engines":["node >=0.6.0"],"_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"_id":"verror@1.0.0","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"5cb98dd3b334144679ed2f9df5d300a2053a71ed","tarball":"http://registry.npmjs.org/verror/-/verror-1.0.0.tgz"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.0.1":{"name":"verror","version":"1.0.1","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.0"},"engines":["node >=0.6.0"],"_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"_id":"verror@1.0.1","devDependencies":{},"_engineSupported":false,"_npmVersion":"1.0.94","_nodeVersion":"v0.4.2","_defaultsLoaded":true,"dist":{"shasum":"758d8fb57cc988fdd744a4186d87ed8ab691e7c7","tarball":"http://registry.npmjs.org/verror/-/verror-1.0.1.tgz"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.1.0":{"name":"verror","version":"1.1.0","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.0"},"engines":["node >=0.6.0"],"_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"_id":"verror@1.1.0","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"2a4b4eb14a207051e75a6f94ee51315bf173a1b0","tarball":"http://registry.npmjs.org/verror/-/verror-1.1.0.tgz"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.2.0":{"name":"verror","version":"1.2.0","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.0"},"engines":["node >=0.6.0"],"_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"_id":"verror@1.2.0","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.24","_nodeVersion":"v0.6.19","_defaultsLoaded":true,"dist":{"shasum":"0bfad0cb643d50ddb02c517cecae9aae6965f28a","tarball":"http://registry.npmjs.org/verror/-/verror-1.2.0.tgz"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.3.0":{"name":"verror","version":"1.3.0","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.0"},"engines":["node >=0.6.0"],"_id":"verror@1.3.0","dist":{"shasum":"e6047cae0bb5bdf862ac0b7e1fa1e1f8e3cfc6db","tarball":"http://registry.npmjs.org/verror/-/verror-1.3.0.tgz"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.3.1":{"name":"verror","version":"1.3.1","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.0"},"engines":["node >=0.6.0"],"_id":"verror@1.3.1","dist":{"shasum":"0d6598b520fdbac16753c2994a9f0f6de8a1ca68","tarball":"http://registry.npmjs.org/verror/-/verror-1.3.1.tgz"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.3.2":{"name":"verror","version":"1.3.2","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.0"},"engines":["node >=0.6.0"],"scripts":{"test":"make test"},"_id":"verror@1.3.2","dist":{"shasum":"371c3a07de6b699cd43f0bc2c7425eea5d5e1b1f","tarball":"http://registry.npmjs.org/verror/-/verror-1.3.2.tgz"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.3.3":{"name":"verror","version":"1.3.3","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.0"},"engines":["node >=0.6.0"],"scripts":{"test":"make test"},"_id":"verror@1.3.3","dist":{"shasum":"8a6a4ac3a8c774b6f687fece49bdffd78552e2cd","tarball":"http://registry.npmjs.org/verror/-/verror-1.3.3.tgz"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.3.4":{"name":"verror","version":"1.3.4","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.0"},"engines":["node >=0.6.0"],"scripts":{"test":"make test"},"_id":"verror@1.3.4","dist":{"shasum":"0cd68820c711206b5157b751d037b6e04a4244f6","tarball":"http://registry.npmjs.org/verror/-/verror-1.3.4.tgz"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.3.5":{"name":"verror","version":"1.3.5","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.0"},"engines":["node >=0.6.0"],"scripts":{"test":"make test"},"_id":"verror@1.3.5","dist":{"shasum":"5d2d0af474628bf6979f25ee869407af9a148c32","tarball":"http://registry.npmjs.org/verror/-/verror-1.3.5.tgz"},"_npmVersion":"1.1.66","_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.3.6":{"name":"verror","version":"1.3.6","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.2"},"engines":["node >=0.6.0"],"scripts":{"test":"make test"},"_id":"verror@1.3.6","dist":{"shasum":"cff5df12946d297d2baaefaa2689e25be01c005c","tarball":"http://registry.npmjs.org/verror/-/verror-1.3.6.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.3.7":{"name":"verror","version":"1.3.7","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.2"},"engines":["node >=0.6.0"],"scripts":{"test":"make test"},"license":"MIT","bugs":{"url":"https://github.com/davepacheco/node-verror/issues"},"_id":"verror@1.3.7","dist":{"shasum":"b9dd10e98d1291ab4dde3746d70ef966162237f0","tarball":"http://registry.npmjs.org/verror/-/verror-1.3.7.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.4.0":{"name":"verror","version":"1.4.0","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.3"},"engines":["node >=0.6.0"],"scripts":{"test":"make test"},"license":"MIT","bugs":{"url":"https://github.com/davepacheco/node-verror/issues"},"_id":"verror@1.4.0","dist":{"shasum":"5d8fdf5875141c3183b7c6bc23a0aa3e3e6ca4e2","tarball":"http://registry.npmjs.org/verror/-/verror-1.4.0.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"directories":{}},"1.5.0":{"name":"verror","version":"1.5.0","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.0.3"},"engines":["node >=0.6.0"],"scripts":{"test":"make test"},"license":"MIT","bugs":{"url":"https://github.com/davepacheco/node-verror/issues"},"homepage":"https://github.com/davepacheco/node-verror","_id":"verror@1.5.0","_shasum":"c0f5b0965ed75f17ed891a7735539173f229e1bc","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"dist":{"shasum":"c0f5b0965ed75f17ed891a7735539173f229e1bc","tarball":"http://registry.npmjs.org/verror/-/verror-1.5.0.tgz"},"directories":{}},"1.5.1":{"name":"verror","version":"1.5.1","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.2.0"},"engines":["node >=0.6.0"],"scripts":{"test":"make test"},"license":"MIT","bugs":{"url":"https://github.com/davepacheco/node-verror/issues"},"homepage":"https://github.com/davepacheco/node-verror","_id":"verror@1.5.1","_shasum":"6ba9003345a4f8c3c6a6ada344f3cd6fa7b98821","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"dist":{"shasum":"6ba9003345a4f8c3c6a6ada344f3cd6fa7b98821","tarball":"http://registry.npmjs.org/verror/-/verror-1.5.1.tgz"},"directories":{}},"1.6.0":{"name":"verror","version":"1.6.0","description":"richer JavaScript errors","main":"./lib/verror.js","repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"dependencies":{"extsprintf":"1.2.0"},"engines":["node >=0.6.0"],"scripts":{"test":"make test"},"license":"MIT","bugs":{"url":"https://github.com/davepacheco/node-verror/issues"},"homepage":"https://github.com/davepacheco/node-verror","_id":"verror@1.6.0","_shasum":"7d13b27b1facc2e2da90405eb5ea6e5bdd252ea5","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"dap","email":"dap@cs.brown.edu"},"maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"dist":{"shasum":"7d13b27b1facc2e2da90405eb5ea6e5bdd252ea5","tarball":"http://registry.npmjs.org/verror/-/verror-1.6.0.tgz"},"directories":{}}},"readme":"# verror: richer JavaScript errors\n\nThis module provides two classes:\n\n* VError, for combining errors while preserving each one's error message, and\n* WError, for wrapping errors.\n\nBoth support printf-style error messages using\n[extsprintf](https://github.com/davepacheco/node-extsprintf).\n\n## printf-style Error constructor\n\nAt the most basic level, VError is just like JavaScript's Error class, but with\nprintf-style arguments:\n\n```javascript\nvar VError = require('verror');\n\nvar filename = '/etc/passwd';\nvar err = new VError('missing file: \"%s\"', filename);\nconsole.log(err.message);\n```\n\nThis prints:\n\n missing file: \"/etc/passwd\"\n\n`err.stack` works the same as for built-in errors:\n\n```javascript\nconsole.log(err.stack);\n```\n\nThis prints:\n\n missing file: \"/etc/passwd\"\n at Object. (/Users/dap/node-verror/examples/varargs.js:4:11)\n at Module._compile (module.js:449:26)\n at Object.Module._extensions..js (module.js:467:10)\n at Module.load (module.js:356:32)\n at Function.Module._load (module.js:312:12)\n at Module.runMain (module.js:492:10)\n at process.startup.processNextTick.process._tickCallback (node.js:244:9)\n\n\n## Causes\n\nYou can also pass a `cause` argument, which is another Error. For example:\n\n```javascript\nvar fs = require('fs');\nvar VError = require('verror');\n\nvar filename = '/nonexistent';\nfs.stat(filename, function (err1) {\n\tvar err2 = new VError(err1, 'stat \"%s\" failed', filename);\n\tconsole.error(err2.message);\n});\n```\n\nThis prints out:\n\n stat \"/nonexistent\" failed: ENOENT, stat '/nonexistent'\n\nwhich resembles how Unix programs typically report errors:\n\n $ sort /nonexistent\n sort: open failed: /nonexistent: No such file or directory\n\nTo match the Unixy feel, just prepend the program's name to the VError's\n`message`.\n\nYou can also get the next-level Error using `err.cause()`:\n\n```javascript\nconsole.error(err2.cause().message);\n```\n\nprints:\n\n ENOENT, stat '/nonexistent'\n\nOf course, you can nest these as many times as you want:\n\n```javascript\nvar VError = require('verror');\nvar err1 = new Error('No such file or directory');\nvar err2 = new VError(err1, 'failed to stat \"%s\"', '/junk');\nvar err3 = new VError(err2, 'request failed');\nconsole.error(err3.message);\n```\n\nThis prints:\n\n request failed: failed to stat \"/junk\": No such file or directory\n\nThe idea is that each layer in the stack annotates the error with a description\nof what it was doing (with a printf-like format string) and the result is a\nmessage that explains what happened at every level.\n\n\n## WError: wrap layered errors\n\nSometimes you don't want an Error's \"message\" field to include the details of\nall of the low-level errors, but you still want to be able to get at them\nprogrammatically. For example, in an HTTP server, you probably don't want to\nspew all of the low-level errors back to the client, but you do want to include\nthem in the audit log entry for the request. In that case, you can use a\nWError, which is created exactly like VError (and also supports both\nprintf-style arguments and an optional cause), but the resulting \"message\" only\ncontains the top-level error. It's also more verbose, including the class\nassociated with each error in the cause chain. Using the same example above,\nbut replacing `err3`'s VError with WError, we get this output:\n\n request failed\n\nThat's what we wanted -- just a high-level summary for the client. But we can\nget the object's toString() for the full details:\n\n WError: request failed; caused by WError: failed to stat \"/nonexistent\";\n caused by Error: No such file or directory\n\n# Contributing\n\nContributions welcome. Code should be \"make check\" clean. To run \"make check\",\nyou'll need these tools:\n\n* https://github.com/davepacheco/jsstyle\n* https://github.com/davepacheco/javascriptlint\n\nIf you're changing something non-trivial or user-facing, you may want to submit\nan issue first.\n","maintainers":[{"name":"dap","email":"dap@cs.brown.edu"}],"time":{"modified":"2015-02-10T18:32:19.673Z","created":"2012-04-18T01:13:51.779Z","1.0.0":"2012-04-18T01:13:53.033Z","1.0.1":"2012-04-18T16:21:48.400Z","1.1.0":"2012-05-01T19:11:24.848Z","1.2.0":"2012-07-11T18:56:59.684Z","1.3.0":"2012-07-27T00:03:18.667Z","1.3.1":"2012-07-27T17:37:13.264Z","1.3.2":"2012-07-30T23:16:11.948Z","1.3.3":"2012-07-30T23:57:10.716Z","1.3.4":"2012-10-17T18:55:23.042Z","1.3.5":"2012-12-14T17:25:51.996Z","1.3.6":"2013-02-06T18:29:57.875Z","1.3.7":"2014-01-15T00:33:58.024Z","1.4.0":"2014-03-13T04:35:07.331Z","1.5.0":"2014-11-17T18:25:19.433Z","1.5.1":"2014-11-17T18:28:09.308Z","1.6.0":"2014-11-20T23:24:57.881Z"},"repository":{"type":"git","url":"git://github.com/davepacheco/node-verror.git"},"users":{"fgribreau":true,"isao":true,"davepoon":true,"juriwiens":true,"wenbing":true,"samshull":true,"forivall":true,"voxpelli":true,"ninjatux":true,"shahzaib":true,"gonzalofj":true,"srl":true,"arikon":true,"jaxon":true,"garek":true,"djensen47":true,"goliatone":true,"barenko":true,"pdedkov":true,"sasquatch":true,"quocnguyen":true,"fuhbaz":true},"readmeFilename":"README.md","bugs":{"url":"https://github.com/davepacheco/node-verror/issues"},"license":"MIT","homepage":"https://github.com/davepacheco/node-verror","_attachments":{},"_etag":"\"C5QK63L6LRE7UO5109U5WIW4E\""}