{"_id":"handle-errors","_rev":"26-1e07b7d8ad393b616b166d571233260e","name":"handle-errors","description":"Handling/creating hybrid errors. Hybrid middleware between callbacks and throws. Helpful util for modules that have hybrid APIs and want when they use promises, directly to throw the errors; when use callbacks to pass errors to first argument of this call","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0":{"name":"handle-errors","version":"0.0.0","description":"Handling/creating hybrid errors, if callback pass to it else throw","scripts":{"lint":"jshint index.js && jscs index.js --reporter inline","test":"mocha","test-cov":"istanbul cover _mocha","test-travis":"istanbul cover _mocha --report lcovonly"},"author":{"name":"Charlike Make Reagent","email":"mameto_100@mail.bg","url":"https://github.com/tunnckoCore"},"repository":{"type":"git","url":"git://github.com/tunnckoCore/handle-errors.git"},"keywords":[],"license":{"type":"MIT","url":"https://github.com/tunnckoCore/handle-errors/blob/master/license.md"},"dependencies":{},"devDependencies":{"istanbul-harmony":"^0.3.1","mocha":"*","mocha-lcov-reporter":"^0.0.1"},"gitHead":"baaf65c69706d561b6ba13190ba2318ae8e13859","bugs":{"url":"https://github.com/tunnckoCore/handle-errors/issues"},"homepage":"https://github.com/tunnckoCore/handle-errors","_id":"handle-errors@0.0.0","_shasum":"d626dae667c07f8f096948aa15ce62eaea943975","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.11.14","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"dist":{"shasum":"d626dae667c07f8f096948aa15ce62eaea943975","tarball":"https://registry.npmjs.org/handle-errors/-/handle-errors-0.0.0.tgz","integrity":"sha512-pKUmLExsOGTNzdOvJpglkjEyjNuIPcqV0s9tScsqlyV1WJRXmlJnuQi7xfZLRUfR7W9tYxW4SQod00tbkKjwEg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmX79+uvjHXmM37Tn1HUQ1M5sqfBj5RlH7BhxUShpapAIhALRKSvKdC5IH/bp//w6K4406qlbzS9yYcQ3LwTBLxKUX"}]},"directories":{}},"0.0.1":{"name":"handle-errors","version":"0.0.1","description":"Handling/creating hybrid errors, if callback pass to it else throw","scripts":{"lint":"jshint index.js && jscs index.js --reporter inline","test":"mocha","test-cov":"istanbul cover _mocha","test-travis":"istanbul cover _mocha --report lcovonly"},"author":{"name":"Charlike Make Reagent","email":"mameto_100@mail.bg","url":"https://github.com/tunnckoCore"},"repository":{"type":"git","url":"git://github.com/hybridables/handle-errors.git"},"keywords":[],"license":{"type":"MIT","url":"https://github.com/hybridables/handle-errors/blob/master/license.md"},"dependencies":{},"devDependencies":{"istanbul-harmony":"^0.3.1","mocha":"*","mocha-lcov-reporter":"^0.0.1"},"gitHead":"b3d1b71bafdb27c3aaf46ba10b54ea2958dc016b","bugs":{"url":"https://github.com/hybridables/handle-errors/issues"},"homepage":"https://github.com/hybridables/handle-errors","_id":"handle-errors@0.0.1","_shasum":"73ca8958d86e4bae09fa5d6cdea1758e6a90b438","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.11.14","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"dist":{"shasum":"73ca8958d86e4bae09fa5d6cdea1758e6a90b438","tarball":"https://registry.npmjs.org/handle-errors/-/handle-errors-0.0.1.tgz","integrity":"sha512-04Qxz8T51RkVXSCmdEGFsnJ0ELrstWJr+lNr3uYzz1dq2zoEsS7CSuJ81wz5PfvdqXhAuSdGTQTqqZ5m2c0N0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVI8S2j3x6Th8UMMTuSm90ZfC28AEldnravssDO9dnsAIhAJUIwCRM/l9s2gBDBSQPxk66rxoSHUAu6vU8HVOn6ZFl"}]},"directories":{}},"0.0.2":{"name":"handle-errors","version":"0.0.2","description":"Handling/creating hybrid errors, if callback pass to it else throw","scripts":{"lint":"jshint index.js && jscs index.js --reporter inline","test":"mocha","test-cov":"istanbul cover _mocha","test-travis":"istanbul cover _mocha --report lcovonly"},"author":{"name":"Charlike Make Reagent","email":"mameto_100@mail.bg","url":"https://github.com/tunnckoCore"},"repository":{"type":"git","url":"git://github.com/hybridables/handle-errors.git"},"keywords":[],"license":{"type":"MIT","url":"https://github.com/hybridables/handle-errors/blob/master/license.md"},"dependencies":{},"devDependencies":{"istanbul-harmony":"^0.3.1","mocha":"*","mocha-lcov-reporter":"^0.0.1"},"gitHead":"bc2901ad6e6677a2f4da7999dbf957ec6bf2e032","bugs":{"url":"https://github.com/hybridables/handle-errors/issues"},"homepage":"https://github.com/hybridables/handle-errors","_id":"handle-errors@0.0.2","_shasum":"d40416652a9c4fbba56521b699e21698e46b1e50","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.11.14","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"dist":{"shasum":"d40416652a9c4fbba56521b699e21698e46b1e50","tarball":"https://registry.npmjs.org/handle-errors/-/handle-errors-0.0.2.tgz","integrity":"sha512-+h4Jeiz5GZzxhH3mrfeAIO1Wt5Z3D5lKv2eOsiviKgoH5itMl4d42SQQcRIKRHqDclsLyd//KYvacl5KsCcqeQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrol6GQ0c0mbiFBRJCrk3FGqNLOupzU9btqG/PL9Y/6QIgRFOr1rO81SP0IduvHtZnZ7CFj5eOSXI8ISnur8kp+AE="}]},"directories":{}},"1.0.0":{"name":"handle-errors","version":"1.0.0","description":"Handling/creating hybrid errors. Hybrid middleware between callbacks and throws. Helpful util for modules that have hybrid APIs and want when they use promises, directly to throw the errors; when use callbacks to pass errors to first argument of this call","scripts":{"lint":"jshint index.js && jscs index.js --reporter inline","test":"mocha","test-cov":"istanbul cover _mocha","test-travis":"istanbul cover _mocha --report lcovonly"},"author":{"name":"Charlike Make Reagent","email":"mameto_100@mail.bg","url":"https://github.com/tunnckoCore"},"repository":{"type":"git","url":"git://github.com/hybridables/handle-errors.git"},"keywords":["api","apis","aplus","callback","callbacks","catch","cb","err","error","errors","handle","hybrid","hybridify","promise","promises","promises-aplus","then","throw"],"license":{"type":"MIT","url":"https://github.com/hybridables/handle-errors/blob/master/license.md"},"dependencies":{},"devDependencies":{"istanbul-harmony":"^0.3.1","mocha":"*","mocha-lcov-reporter":"^0.0.1"},"gitHead":"3600dbc85a549c2ee0e4da95b37d6f022ee559e5","bugs":{"url":"https://github.com/hybridables/handle-errors/issues"},"homepage":"https://github.com/hybridables/handle-errors","_id":"handle-errors@1.0.0","_shasum":"371f15946a0a131d89688456514881a9a3a8e2d4","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.11.14","_npmUser":{"name":"tunnckocore","email":"mameto_100@mail.bg"},"maintainers":[{"name":"tunnckocore","email":"mameto_100@mail.bg"}],"dist":{"shasum":"371f15946a0a131d89688456514881a9a3a8e2d4","tarball":"https://registry.npmjs.org/handle-errors/-/handle-errors-1.0.0.tgz","integrity":"sha512-Jd0XavC+Xbn6sAQetyBF/gtXTve49vi+A6BLaqPhvZAA2E3VKBqbhcfSICNn/CntSPFtIKhwmLBRXjcCaoNAUg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9LqL4PTnSWcyHi2lcB75B0eQeebE+Ct1aQa2Yct8YkAIhAL7rvV6AoftmuXh+7uF8ZZ/vab0dUssFSxkXfmAiDryG"}]},"directories":{}}},"readme":"## [![npm][npmjs-img]][npmjs-url] [![mit license][license-img]][license-url] [![build status][travis-img]][travis-url] [![coverage status][coveralls-img]][coveralls-url] [![deps status][daviddm-img]][daviddm-url]\n\n> Handling/creating hybrid errors. Hybrid middleware between callbacks and throws.  \n> Helpful util for modules that have [hybrid APIs][hybridify] and want when they use [promises][gitclone], directly to throw the errors; when use callbacks to pass errors to first argument of this callback.\n\n## Install\n```\nnpm i --save handle-errors\nnpm test\n```\n\n\n## API\n> For more use-cases see the [tests](./test.js)\n\n### [handleErrors](./index.js#L44)\n> Useful when you have [hybrid api][hybridify] like [gitclone][gitclone]. If you work with promises then you will want to throw the errors, when callback is in use will handle it in 1st argument.\n\n- `label` **{String}** some marker (package name?)\n- `stack` **{Boolean}** when `true` adds `.shortStack` property to the error object \n- `return` **{Error|TypeError}** throws it or return `callback` function\n\n**Example:**\n\n```js\nvar handleErrors = require('handle-errors')('my-pkg'/*, true*/);\n\nhandleErrors.error('some err message here');\n//=> throws 'Error: [my-pkg] some error message here'\n\nfunction _cb(err) {\n  // err instanceof Error\n  console.log(err.toString());\n  //=> 'Error: [my-pkg] some error message here'\n\n  console.log(err.shortStack);\n  //=> undefined\n}\n\nhandleErrors.error('some err message here', _cb);\n```\n\n\n## Related\n- [hybridables][hybridables]\n- [hybridify][hybridify]\n- [hybridify-all][hybridify-all]\n- [then-got][then-got]\n- [gitclone][gitclone]\n- [gitclone-cli][gitclone-cli]\n- [handle-callback][handle-callback]\n- [handle-arguments][handle-arguments]\n- [callback-and-promise][callback-and-promise]\n- [thenify-all][thenify-all]\n- [thenify][thenify]\n- [thenables][thenables]\n\n\n## Author\n**Charlike Mike Reagent**\n+ [gratipay/tunnckoCore][author-gratipay]\n+ [twitter/tunnckoCore][author-twitter]\n+ [github/tunnckoCore][author-github]\n+ [npmjs/tunnckoCore][author-npmjs]\n+ [more ...][contrib-more]\n\n\n## License [![MIT license][license-img]][license-url]\nCopyright (c) 2014-2015 [Charlike Mike Reagent][contrib-more], [contributors][contrib-graf].  \nReleased under the [`MIT`][license-url] license.\n\n\n[npmjs-url]: http://npm.im/handle-errors\n[npmjs-img]: https://img.shields.io/npm/v/handle-errors.svg?style=flat&label=handle-errors\n\n[coveralls-url]: https://coveralls.io/r/hybridables/handle-errors?branch=master\n[coveralls-img]: https://img.shields.io/coveralls/hybridables/handle-errors.svg?style=flat\n\n[license-url]: https://github.com/hybridables/handle-errors/blob/master/license.md\n[license-img]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat\n\n[travis-url]: https://travis-ci.org/hybridables/handle-errors\n[travis-img]: https://img.shields.io/travis/hybridables/handle-errors.svg?style=flat\n\n[daviddm-url]: https://david-dm.org/hybridables/handle-errors\n[daviddm-img]: https://img.shields.io/david/dev/hybridables/handle-errors.svg?style=flat\n\n[author-gratipay]: https://gratipay.com/tunnckoCore\n[author-twitter]: https://twitter.com/tunnckoCore\n[author-github]: https://github.com/tunnckoCore\n[author-npmjs]: https://npmjs.org/~tunnckocore\n\n[contrib-more]: http://j.mp/1stW47C\n[contrib-graf]: https://github.com/hybridables/handle-errors/graphs/contributors\n\n***\n\n_Powered and automated by [kdf](https://github.com/tunnckoCore), January 30, 2015_\n\n[callback-and-promise]: https://github.com/thenables/callback-and-promise\n[thenify-all]: https://github.com/thenables/thenify-all\n[thenify]: https://github.com/thenables/thenify\n[thenables]: https://github.com/thenables\n[hybridables]: https://github.com/hybridables\n[hybridify]: https://github.com/hybridables/hybridify\n[hybridify-all]: https://github.com/hybridables/hybridify-all\n[handle-callback]: https://github.com/hybridables/handle-callback\n[handle-arguments]: https://github.com/hybridables/handle-arguments\n[handle-errors]: https://github.com/hybridables/handle-errors\n[gitclone]: https://github.com/tunnckoCore/gitclone\n[gitclone-cli]: https://github.com/tunnckoCore/gitclone-cli\n[then-got]: https://github.com/hybridables/then-got","maintainers":[{"email":"super.ludiq@gmail.com","name":"vanchoy"},{"email":"mameto2011@gmail.com","name":"tunnckocore"}],"time":{"modified":"2022-06-18T18:51:10.166Z","created":"2015-01-25T12:08:49.475Z","0.0.0":"2015-01-25T12:08:49.475Z","0.0.1":"2015-01-26T12:11:19.698Z","0.0.2":"2015-01-26T21:31:44.844Z","1.0.0":"2015-01-30T03:43:34.470Z"},"homepage":"https://github.com/hybridables/handle-errors","keywords":["api","apis","aplus","callback","callbacks","catch","cb","err","error","errors","handle","hybrid","hybridify","promise","promises","promises-aplus","then","throw"],"repository":{"type":"git","url":"git://github.com/hybridables/handle-errors.git"},"author":{"name":"Charlike Make Reagent","email":"mameto_100@mail.bg","url":"https://github.com/tunnckoCore"},"bugs":{"url":"https://github.com/hybridables/handle-errors/issues"},"license":{"type":"MIT","url":"https://github.com/hybridables/handle-errors/blob/master/license.md"},"readmeFilename":"readme.md"}