{"name":"nested-error-stacks","version":"0.0.5","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":"https://github.com/mdlavin/nested-error-stacks.git"},"main":"index.js","scripts":{"test":"mocha"},"author":{"name":"Matt Lavin","email":"matt.lavin@gmail.com"},"license":"MIT","devDependencies":{"mocha":"~1.18.2","uuid":"~1.4.1","chai":"~1.9.1"},"gitHead":"52763e5967cdf392cd215a035cbd2dac5b99dffc","homepage":"https://github.com/mdlavin/nested-error-stacks","_id":"nested-error-stacks@0.0.5","_shasum":"b239338208fd783cd3d0b6c597a83d2027f9cf58","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mdlavin","email":"matt.lavin@gmail.com"},"maintainers":[{"name":"mdlavin","email":"matt.lavin@gmail.com"}],"dist":{"shasum":"b239338208fd783cd3d0b6c597a83d2027f9cf58","tarball":"http://registry-npm.ywwl.com/nested-error-stacks/download/nested-error-stacks-0.0.5.tgz","integrity":"sha512-QTNYhS2xblXLm3/NKitAaHCo48fU6XBnvqAiQgSKfRVStkJRgLu2/JeCQU/FeOqFS0mVNSM8Vd7IVAthmG111g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFBM7AK9A0I2kU5SpCgv1wnJTBfttn0HYDmeqlvEM7xPAiEA+wGUCdOsXK1k6xSK5dl2JZixeiw7c455ZhJHjf94klg="}],"size":2804,"noattachment":false,"key":"/nested-error-stacks/-/nested-error-stacks-0.0.5.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":1427721675528,"_cnpm_publish_time":1427721675528,"dist-tags":{"latest":"2.1.1"}}