{"name":"nested-error-stacks","version":"1.0.2","description":"An Error subclass that will chain nested Errors and dump nested stacktraces","bugs":{"url":"https://github.com/mdlavin/nested-error-stacks/issues"},"keywords":["error","nested","stack"],"repository":{"type":"git","url":"git+https://github.com/mdlavin/nested-error-stacks.git"},"main":"index.js","files":["index.js","LICENSE"],"scripts":{"test":"if [ \"$RUN_ZUUL\" != \"true\" ]; then node_modules/.bin/mocha; else npm install zuul && node_modules/.bin/zuul -- test.js; fi"},"author":{"name":"Matt Lavin","email":"matt.lavin@gmail.com"},"license":"MIT","dependencies":{"inherits":"~2.0.1"},"devDependencies":{"chai":"~1.9.1","mocha":"~1.18.2","uuid":"~1.4.1"},"gitHead":"7eb0c2058a0fd038d63703b953ca9bacd70b866f","homepage":"https://github.com/mdlavin/nested-error-stacks#readme","_id":"nested-error-stacks@1.0.2","_shasum":"19f619591519f096769a5ba9a86e6eeec823c3cf","_from":".","_npmVersion":"2.13.2","_nodeVersion":"2.5.0","_npmUser":{"name":"mdlavin","email":"matt.lavin@gmail.com"},"maintainers":[{"name":"mdlavin","email":"matt.lavin@gmail.com"}],"dist":{"shasum":"19f619591519f096769a5ba9a86e6eeec823c3cf","tarball":"http://registry-npm.ywwl.com/nested-error-stacks/download/nested-error-stacks-1.0.2.tgz","integrity":"sha512-o32anp9JA7oezPOFSfG2BBXSdHepOm5FpJvwxHWDtfJ3Bg3xdi68S6ijPlEOfUg6quxZWyvJM+8fHk1yMDKspA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBTh0SnNXTUGIK1s6IfO9v/NTIjuwhkVdHzpLbtR4CHoAiBZX3n9Y1UjR12XzFDUcRQlyEJ9OzMW+aHVzLcwhKZ64A=="}],"size":2359,"noattachment":false,"key":"/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz"},"directories":{},"readme":"Nested stacktraces for Node.js!\n===============================\n\n[![Build Status](https://github.com/mdlavin/nested-error-stacks/actions/workflows/test.yaml/badge.svg)](https://github.com/mdlavin/nested-error-stacks/actions?query=branch%3Amaster)\n[![NPM version](https://badge.fury.io/js/nested-error-stacks.svg)](http://badge.fury.io/js/nested-error-stacks)\n\nWith this module, you can wrap a caught exception with extra context\nfor better debugging.  For example, a network error's stack would normally look\nlike this:\n\n    Error: connect ECONNREFUSED\n        at errnoException (net.js:904:11)\n        at Object.afterConnect [as oncomplete] (net.js:895:19)\n\nUsing this module, you can wrap the Error with more context to get a stack\nthat looks like this:\n\n    NestedError: Failed to communicate with localhost:8080\n        at Socket.<anonymous> (/Users/mattlavin/Projects/nested-stacks/demo.js:6:18)\n        at Socket.EventEmitter.emit (events.js:95:17)\n        at net.js:440:14\n        at process._tickCallback (node.js:415:13)\n    Caused By: Error: connect ECONNREFUSED\n        at errnoException (net.js:904:11)\n        at Object.afterConnect [as oncomplete] (net.js:895:19)\n\nHow to wrap errors\n------------------\n\nHere is an example program that uses this module to add more context to errors:\n\n```js\nvar NestedError = require('nested-error-stacks');\nvar net = require('net');\n    \nvar client = net.connect({port: 8080});\nclient.on('error', function (err) {\n    var newErr = new NestedError(\"Failed to communicate with localhost:8080\", err);\n    console.log(newErr.stack);\n});\n```\n\nHow to inherit\n--------------\n\nIt is recommended to use explicit names for Error classes. You can do it\nlike this:\n\n```js\nvar util = require('util');\nvar NestedError = require('nested-error-stacks');\n\nfunction MyError(message, nested) {\n    NestedError.call(this, message, nested);\n}\n\nutil.inherits(MyError, NestedError);\nMyError.prototype.name = 'MyError';\n```\n","publish_time":1448036053042,"_cnpm_publish_time":1448036053042,"dist-tags":{"latest":"2.1.1"}}