{"name":"explain-error","description":"wrap errors in explainations.","version":"1.0.3","homepage":"https://github.com/dominictarr/explain-error","repository":{"type":"git","url":"git://github.com/dominictarr/explain-error.git"},"scripts":{"test":"set -e; for t in test/*.js; do node $t; done"},"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"http://dominictarr.com"},"license":"MIT","gitHead":"8d0c70e030207e6a372ef3527767db699b362523","bugs":{"url":"https://github.com/dominictarr/explain-error/issues"},"_id":"explain-error@1.0.3","_shasum":"f4e2b21152120d94db36d93bef03a5c42bfedce9","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"dist":{"shasum":"f4e2b21152120d94db36d93bef03a5c42bfedce9","tarball":"http://registry-npm.ywwl.com/explain-error/download/explain-error-1.0.3.tgz","integrity":"sha512-ArA0CuHjoGcm50cjZpz2Ut+WtdsKKOQ2SrhNW8nU0v/NnC+FZG2u/rJFIRk9wRP+gIB4Sh+gQhSpPAKFSmQBrw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDwFlnGeXnXrIGOcm9RfllLKo8qjaQNagf8E72JByjpIAiAp8sV7qbNt96UQURRF4CsqDDJzXY2Asd+IFW4FkoqpBA=="}],"size":1994,"noattachment":false,"key":"/explain-error/-/explain-error-1.0.3.tgz"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/explain-error-1.0.3.tgz_1468115241550_0.9341711369343102"},"directories":{},"readme":"# explain-error\n\nwrap errors in explainations.\n\nIn node sometimes something fails because of some internal detail,\nbut then this error may be passed back somewhere else, too often,\ncontext is lost.\n\n## example\n\n``` js\nvar explain = require('explain-error')\n\n//stat a file that does not exist. this will error, add an explaination.\nfunction explainedError(cb) {\n  require('fs').stat('neoatuhrcoahkrcophkr', function (err) {\n    if(err) cb(explain(err, 'asked for a file that certainly did not exist'))\n    else cb()\n  })\n}\n\n//show that this works even with multiple layers of explainations.\nexplainedError(function (err) {\n  throw explain(err, 'called an function that was expected to fail')\n})\n```\n\noutput:\n\n`fs.stat` does not show where it was called from,\nbut at least now you know what happened after that.\n\n```\nError: called an function that was expected to fail\n    at /home/dominic/c/explain-error/example.js:11:9\n    at /home/dominic/c/explain-error/example.js:5:13\n  Error: asked for a file that certainly did not exist\n    at /home/dominic/c/explain-error/example.js:5:16\n    at Object.oncomplete (fs.js:107:15)\n  Error: ENOENT, stat neoatuhrcoahkrcophkr\n\n```\n\n## parsing stack traces\n\nof course, this adds lines to your errors that will do not look like normal js errors.\nwill this break all your tools? if so please post an issue.\n\n## License\n\nMIT\n","publish_time":1468115241975,"_cnpm_publish_time":1468115241975,"dist-tags":{"latest":"1.0.4"}}