{"_id":"custom-error","_rev":"2764015","name":"custom-error","description":"Create custom errors that inherit Error","dist-tags":{"latest":"0.2.1"},"maintainers":[{"name":"andrezsanchez","email":"andrezacsanchez@gmail.com"}],"time":{"modified":"2022-02-14T08:03:52.000Z","created":"2014-06-14T02:52:54.723Z","0.2.1":"2014-12-29T14:45:41.333Z","0.2.0":"2014-11-18T02:41:22.644Z","0.1.1":"2014-06-14T18:05:43.035Z","0.1.0":"2014-06-14T02:52:54.723Z"},"users":{},"author":{"name":"Andre Z. Sanchez"},"repository":{"type":"git","url":"git://github.com/andrezsanchez/custom-error.git"},"versions":{"0.2.1":{"name":"custom-error","version":"0.2.1","author":{"name":"Andre Z. Sanchez"},"description":"Create custom errors that inherit Error","main":"index.js","dependencies":{},"devDependencies":{"rewire":"^2.1.3","tap-spec":"~0.2.0","tape":"~2.13.3"},"engines":{"node":">=0.10.0"},"scripts":{"test":"tape test/*.js | tap-spec"},"keywords":["error","inherit","prototype"],"repository":{"type":"git","url":"git://github.com/andrezsanchez/custom-error.git"},"homepage":"https://github.com/andrezsanchez/custom-error","license":"MIT","gitHead":"12f6a88ce38cd7cec67b4eb8dbaaaf3795e2e7cf","bugs":{"url":"https://github.com/andrezsanchez/custom-error/issues"},"_id":"custom-error@0.2.1","_shasum":"ddbf21cbba9f3beb5357335e0576b4c9534a08fe","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"andrezsanchez","email":"andrezacsanchez@gmail.com"},"maintainers":[{"name":"andrezsanchez","email":"andrezacsanchez@gmail.com"}],"dist":{"shasum":"ddbf21cbba9f3beb5357335e0576b4c9534a08fe","size":3810,"noattachment":false,"key":"/custom-error/-/custom-error-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/custom-error/download/custom-error-0.2.1.tgz"},"directories":{},"publish_time":1419864341333,"_hasShrinkwrap":false,"_cnpm_publish_time":1419864341333,"_cnpmcore_publish_time":"2021-12-16T23:13:39.664Z"},"0.2.0":{"name":"custom-error","version":"0.2.0","author":{"name":"Andre Z. Sanchez"},"description":"Create custom errors that inherit Error","main":"index.js","dependencies":{},"devDependencies":{"tape":"~2.13.3","tap-spec":"~0.2.0"},"engines":{"node":">=0.10.0"},"scripts":{"test":"tape test/*.js | tap-spec"},"keywords":["error","inherit","prototype"],"repository":{"type":"git","url":"git://github.com/andrezsanchez/custom-error.git"},"testling":{"files":"test/*.js","browsers":["ie/6..latest","chrome/22..latest","firefox/16..latest","safari/latest","opera/11.0..latest","iphone/6","ipad/6","android-browser/latest"]},"homepage":"https://github.com/andrezsanchez/custom-error","license":"MIT","gitHead":"ebc8c008f361964e0f30f6c2d069bf8a5b17e6f1","bugs":{"url":"https://github.com/andrezsanchez/custom-error/issues"},"_id":"custom-error@0.2.0","_shasum":"1fffdce1b3d0db6f8d4e26f5ffb338903cbf043b","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"andrezsanchez","email":"andrezacsanchez@gmail.com"},"maintainers":[{"name":"andrezsanchez","email":"andrezacsanchez@gmail.com"}],"dist":{"shasum":"1fffdce1b3d0db6f8d4e26f5ffb338903cbf043b","size":2276,"noattachment":false,"key":"/custom-error/-/custom-error-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/custom-error/download/custom-error-0.2.0.tgz"},"directories":{},"publish_time":1416278482644,"_hasShrinkwrap":false,"_cnpm_publish_time":1416278482644,"_cnpmcore_publish_time":"2021-12-16T23:13:39.874Z"},"0.1.1":{"name":"custom-error","version":"0.1.1","author":{"name":"Andre Z. Sanchez"},"description":"Create custom errors that inherit Error","main":"index.js","directories":{"test":"test"},"dependencies":{},"devDependencies":{"tape":"~2.13.3","tap-spec":"~0.2.0"},"scripts":{"test":"tape test/*.js | ./node_modules/.bin/tap-spec"},"keywords":["error","inherit","prototype"],"repository":{"type":"git","url":"git://github.com/AndreZSanchez/custom-error.git"},"testling":{"files":"test/*.js","browsers":["ie/6..latest","chrome/22..latest","firefox/16..latest","safari/latest","opera/11.0..latest","iphone/6","ipad/6","android-browser/latest"]},"homepage":"https://github.com/AndreZSanchez/custom-error","license":"MIT","bugs":{"url":"https://github.com/AndreZSanchez/custom-error/issues"},"_id":"custom-error@0.1.1","dist":{"shasum":"452fe108e164c7794eacbc3bd0a725f7a8d35ca2","size":2134,"noattachment":false,"key":"/custom-error/-/custom-error-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/custom-error/download/custom-error-0.1.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"andrezsanchez","email":"andrezacsanchez@gmail.com"},"maintainers":[{"name":"andrezsanchez","email":"andrezacsanchez@gmail.com"}],"publish_time":1402769143035,"_hasShrinkwrap":false,"_cnpm_publish_time":1402769143035,"_cnpmcore_publish_time":"2021-12-16T23:13:40.059Z"},"0.1.0":{"name":"custom-error","version":"0.1.0","author":{"name":"Andre Z. Sanchez"},"description":"Create custom errors that inherit Error","main":"index.js","directories":{"test":"test"},"dependencies":{},"devDependencies":{"tape":"~2.13.3","tap-spec":"~0.2.0"},"scripts":{"test":"tape test/*.js | ./node_modules/.bin/tap-spec"},"keywords":["error","inherit","prototype"],"repository":{"type":"git","url":"git://github.com/AndreZSanchez/custom-error.git"},"homepage":"https://github.com/AndreZSanchez/custom-error","license":"MIT","bugs":{"url":"https://github.com/AndreZSanchez/custom-error/issues"},"_id":"custom-error@0.1.0","dist":{"shasum":"b3967433ceb82c7d1357eb9c5e32dbfcf002257a","size":1779,"noattachment":false,"key":"/custom-error/-/custom-error-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/custom-error/download/custom-error-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"andrezsanchez","email":"andrezacsanchez@gmail.com"},"maintainers":[{"name":"andrezsanchez","email":"andrezacsanchez@gmail.com"}],"publish_time":1402714374723,"_hasShrinkwrap":false,"_cnpm_publish_time":1402714374723,"_cnpmcore_publish_time":"2021-12-16T23:13:40.259Z"}},"readme":"# custom-error\n\nCreate custom errors that inherit Error.\n\n[![build status](https://secure.travis-ci.org/andrezsanchez/custom-error.png)](http://travis-ci.org/andrezsanchez/custom-error)\n\n# why\n\nExtending Error is a real [pain](http://stackoverflow.com/questions/1382107/whats-a-good-way-to-extend-error-in-javascript), so this library deals with the quirks, providing a clean API to extend Error that works across JS environments, including Node and browsers.\n\n# usage\n\nCalling `customError(errorTitle[, ParentError])` creates a new error class that can be called the\nsame way that `Error` is called. The new error constructor will inherit from `Error`, or from\n`ParentError` if you provide it.\n\n# examples\n\n``` js\nvar customError = require('custom-error');\n\nvar ApocalypseError = customError('ApocalypseError');\n\nApocalypseError() instanceof Error           // true\nApocalypseError() instanceof ApocalypseError // true\n\nvar UnixApocalypseError = customError('UnixApocalypseError', ApocalypseError)\n\nUnixApocalypseError() instanceof Error                 // true\nUnixApocalypseError() instanceof ApocalypseError       // true\nUnixApocalypseError() instanceof UnixApocalypseError   // true\n\nif (new Date().getFullYear() === 2038) {\n  throw UnixApocalypseError('OH NOES')\n}\n```\n\n## Using prototype\n\n``` js\nUnixApocalypseError.prototype.year = 2038\n\ntry {\n  throw UnixApocalypseError()\n}\ncatch (err) {\n  console.log(err.year) // 2038\n}\n```\n\n\n# installation\n\n``` bash\nnpm install custom-error\n```\n\n# license\n\nMIT\n","_attachments":{},"homepage":"https://github.com/andrezsanchez/custom-error","bugs":{"url":"https://github.com/andrezsanchez/custom-error/issues"},"license":"MIT"}