{"_id":"@amphibian/errors","_rev":"17-baa8997149c1e4887246f5b600be0470","name":"@amphibian/errors","description":"easily create meaningful errors","dist-tags":{"latest":"2.0.0","lerna-temp":"1.0.4"},"versions":{"1.0.0":{"name":"@amphibian/errors","version":"1.0.0","description":"easily create meaningful errors","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/modules.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/modules/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/modules#README","dependencies":{"@amphibian/object-has-property":"^1.0.1"},"_id":"@amphibian/errors@1.0.0","_shasum":"2631f2a1c33e3ba975ebe7808a5f437531261593","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"amphibian","email":"t@hom.as"},"dist":{"shasum":"2631f2a1c33e3ba975ebe7808a5f437531261593","tarball":"https://registry.npmjs.org/@amphibian/errors/-/errors-1.0.0.tgz","integrity":"sha512-njDI/LEIHlDDqKP/RG5ywat3kyltpX5Rx0ScHmHGsokcTeTKpipdLF63b1dPaipYXjeLvKQiKcfmLSuDiV+eOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQDhJ3bwiVhrrp77cEKgtpri2u0U3o/R5c0yw9laP6ePSAIfXxEmWWUehsRKSd6YOwJLqXTGD/kCzY8HoCDTIU93lA=="}]},"maintainers":[{"name":"amphibian","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/errors-1.0.0.tgz_1480977577258_0.03671986795961857"},"directories":{}},"1.0.1":{"name":"@amphibian/errors","version":"1.0.1","description":"easily create meaningful errors","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/modules.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/modules/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/modules#README","dependencies":{"@amphibian/object-has-property":"^1.0.0"},"_id":"@amphibian/errors@1.0.1","_shasum":"4a336c4531a0a0418fbe98870b5c97284cdce2d0","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"amphibian","email":"t@hom.as"},"dist":{"shasum":"4a336c4531a0a0418fbe98870b5c97284cdce2d0","tarball":"https://registry.npmjs.org/@amphibian/errors/-/errors-1.0.1.tgz","integrity":"sha512-gtYt9HI3yBobJ3XGtevMZvqOGggWKPOFv6zJ8zVOS1FQCx5SV6wJvoSqgtVOUPOX7GJc7+2GGgiVvFXQIceHvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEOaWNJdGWSd2t99thl9s71Y0g7ddytMPQn1lVM4WVEAIhAKS9nOXTaL8QXNMORNsxXR5dFS1oJoEdMDKlEn1t4QZ+"}]},"maintainers":[{"name":"amphibian","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/errors-1.0.1.tgz_1480977996988_0.4994087310042232"},"directories":{}},"1.0.2":{"name":"@amphibian/errors","version":"1.0.2","description":"easily create meaningful errors","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/modules.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/modules/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/modules#README","dependencies":{"@amphibian/object-has-property":"^1.0.0"},"_id":"@amphibian/errors@1.0.2","_shasum":"9ac00cd17d0907e9b6389c5058498588d30b19fc","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"amphibian","email":"t@hom.as"},"dist":{"shasum":"9ac00cd17d0907e9b6389c5058498588d30b19fc","tarball":"https://registry.npmjs.org/@amphibian/errors/-/errors-1.0.2.tgz","integrity":"sha512-jg3rLpSzEoTFrUpzmL4eNnWT9KvRvrKXwEuxSBh9MlsSFKM1xtTv72qoFK4oyKIyRucS5fgAY2c1fehNNO6RPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCr9QradNk9JEwqEmeJCKypJZvEQwe2QmbbEd3BFkLSKwIhAJGjLk/N+1fkSnsKU5PHuAaQMkDxQ5f3v/EPHpnE9HoO"}]},"maintainers":[{"name":"amphibian","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/errors-1.0.2.tgz_1481721686131_0.27714734920300543"},"directories":{}},"1.0.4":{"name":"@amphibian/errors","version":"1.0.4","description":"easily create meaningful errors","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/modules.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/modules/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/modules#README","dependencies":{"@amphibian/object-has-property":"^1.0.2"},"_id":"@amphibian/errors@1.0.4","_shasum":"6ed502bba9088177beb5e97532e9bbffb1ce32a9","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"amphibian","email":"t@hom.as"},"dist":{"shasum":"6ed502bba9088177beb5e97532e9bbffb1ce32a9","tarball":"https://registry.npmjs.org/@amphibian/errors/-/errors-1.0.4.tgz","integrity":"sha512-/gZdYh8xZWudCeGbSb/RlUkDrfOdV6th6v4481FHyD8t9BxZa4KuIxi4TWVZxKDLg53iojiOxhGSXBaSuc7Ihg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA3o7YRCQkgbVyFbZ4ivriIYsILODkqqSKjPZYEpICJFAiAZLdrW8D3GvcG+vBnSHVLQ7QQCVXGO4zKtzwRa6NETEA=="}]},"maintainers":[{"name":"amphibian","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/errors-1.0.4.tgz_1481725842795_0.05869526555761695"},"directories":{}},"1.0.3":{"name":"@amphibian/errors","version":"1.0.3","description":"easily create meaningful errors","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/modules.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/modules/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/modules#README","dependencies":{"@amphibian/object-has-property":"^1.0.1"},"_id":"@amphibian/errors@1.0.3","_shasum":"166e8a23c0dc0705bb7c61a78286b6638892a090","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"amphibian","email":"t@hom.as"},"dist":{"shasum":"166e8a23c0dc0705bb7c61a78286b6638892a090","tarball":"https://registry.npmjs.org/@amphibian/errors/-/errors-1.0.3.tgz","integrity":"sha512-t+QbMd03WqzH1FvmBdXQB3pTW2Rb8Uab6oi9P1l7KJrqGY8VmB4iI6FWyIeJj154j3bcmx+Y63/39AlhvMBRDA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICufavgKBynAjWdqy218OPeCjkJJLT1hKjOjPRTsXUE6AiB+9v/dhqpSzSZNVUrw/YP4W9XYKBpFjTneLnD26vOqKw=="}]},"maintainers":[{"name":"amphibian","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/errors-1.0.3.tgz_1481729338978_0.44844021182507277"},"directories":{}},"1.0.5":{"name":"@amphibian/errors","version":"1.0.5","description":"easily create meaningful errors","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/modules.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/modules/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/modules#README","dependencies":{"@amphibian/object-has-property":"^1.0.1"},"_id":"@amphibian/errors@1.0.5","_shasum":"2f00598303600f1803e5b97e9ba122078e1fafad","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"amphibian","email":"t@hom.as"},"dist":{"shasum":"2f00598303600f1803e5b97e9ba122078e1fafad","tarball":"https://registry.npmjs.org/@amphibian/errors/-/errors-1.0.5.tgz","integrity":"sha512-/zOcOPP5X0mLrztY9Pq9vlPm7sXCd7mWhtArKLXGM8o39hxOp6n9v5kY2/q3w5AQNFe5tLKVhEV9NXdElw2G4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA19YcSUj0S4KEMwAd4l6GsJKsx+L8P2hno3twbKELlWAiEAw1gU3Q5VrIiYE4UzVpkra0DSGO2IOJi2qwA72FyPbOI="}]},"maintainers":[{"name":"amphibian","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/errors-1.0.5.tgz_1483627566477_0.610098687466234"},"directories":{}},"1.0.6":{"name":"@amphibian/errors","version":"1.0.6","description":"easily create meaningful errors","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/modules.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/modules/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/modules#README","dependencies":{"@amphibian/object-has-property":"^1.0.1"},"_id":"@amphibian/errors@1.0.6","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"thomaslindstr_m2","email":"t@hom.as"},"dist":{"integrity":"sha512-wtLQWxQkmPvHIcKWb0zx/sxgl/jxcII3XbrTJyNXiFujlZAi+WsYr1vp4WB+E2NsK+VEZ/fMXb78s61l2MgxdQ==","shasum":"a01c58ea49ab165924d61a5b9290ca0a468fac43","tarball":"https://registry.npmjs.org/@amphibian/errors/-/errors-1.0.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJ3Ir/OnSmM3IgJatHADZ1NtvjLLfMpqM7UD9wDtOqzQIhAOoFO9YxvKtSqg8m46qI3tax/8FMmtcgBsPu7jAxneK+"}]},"maintainers":[{"name":"thomaslindstr_m2","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/errors-1.0.6.tgz_1501981679814_0.10581659921444952"},"directories":{}},"1.0.7":{"name":"@amphibian/errors","version":"1.0.7","description":"easily create meaningful errors","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/modules.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/modules/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/modules#README","dependencies":{"@amphibian/object-has-property":"^1.0.1"},"_id":"@amphibian/errors@1.0.7","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"thomaslindstr_m2","email":"t@hom.as"},"dist":{"integrity":"sha512-RfYZR963qU9kyweEybPBFnNimsfZyyp0es6xj/1/NjXTG0R0Jed+SD6uHniW7ccOrRb8OnyfrhFaa+h9Ne65mw==","shasum":"ca72e3871b9c5ea7997ef6a0ab50c66230cf7d81","tarball":"https://registry.npmjs.org/@amphibian/errors/-/errors-1.0.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFUn7kmTOexlDnDuO/SZ1a3vXGwWL05169FBfZPzB3wLAiB56CvB/9cCJcmVeIx0LZM9K9Af1i3/OeQRDbiYg4RycA=="}]},"maintainers":[{"name":"thomaslindstr_m2","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/errors-1.0.7.tgz_1501981829637_0.0615188127849251"},"directories":{}},"2.0.0":{"name":"@amphibian/errors","version":"2.0.0","description":"easily create meaningful errors","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/modules.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"license":"ISC","bugs":{"url":"https://gitlab.com/thomaslindstr_m/modules/issues"},"homepage":"https://gitlab.com/thomaslindstr_m/modules#README","dependencies":{"@amphibian/object-has-property":"^1.0.1"},"gitHead":"f05831ef06438c8bf0780978bdf6663b25f8780b","_id":"@amphibian/errors@2.0.0","_npmVersion":"5.4.2","_nodeVersion":"8.5.0","_npmUser":{"name":"thomaslindstr_m2","email":"t@hom.as"},"dist":{"integrity":"sha512-qiPlzKVQdEC8hKR72Mb9rqS1dK0GVdkCFsCsE6h8S6TVj5R4obwkmxoWX/e9mG7bH9hxHFggnNMbtUNcmrjLHg==","shasum":"294af8cdf10d537f94dbf4da6196a92c7f5a2d4e","tarball":"https://registry.npmjs.org/@amphibian/errors/-/errors-2.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHtb1BDIU6awTsaF++8e9czV8j930eMdXyMGqvz4ozuwIgG514Iq7gA4xJHK3L1TSSLkovRG+K+mYzZF1mBHrlPrA="}]},"maintainers":[{"name":"thomaslindstr_m2","email":"t@hom.as"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/errors-2.0.0.tgz_1505951854984_0.0000025811605155467987"},"directories":{}}},"readme":"# errors\n\n[![build status](https://gitlab.com/thomaslindstr_m/errors/badges/master/build.svg)](https://gitlab.com/thomaslindstr_m/errors/commits/master)\n\neasily create meaningful errors\n\n```\nnpm install @amphibian/errors\n```\n\n```javascript\nvar errors = require('@amphibian/errors');\n\ntry {\n    throw errors.invalidInput('invalid_email_address', 'email', 't@hom.as');\n} catch (error) {\n    console.log(error);\n\n    /*\n    {\n        [Error: Invalid Input (invalid_email_address): email t@hom.as]\n            status: 400,\n            type: 'invalid_input',\n            code: 'invalid_email_address',\n            data: ['email', 't@hom.as']\n    }\n    */\n}\n```\n\n## Create your own error\n\n```javascript\nvar myError = errors.newError('My Error', {\n    status: 400,\n    type: 'my_error',\n    class: TypeError,\n    stack: true\n});\n\ntry {\n    throw myError('my_error_code', 'Some description', 382763);\n} catch (error) {\n    console.log(error);\n\n    /*\n    {\n        TypeError: My Error (my_error_code): Some description 382763\n            at [[... stack trace ...]]\n\n            status: 400,\n            type: 'my_error',\n            code: 'my_error_code',\n            data: ['Some description', 'Some more information here']\n    }\n    */\n}\n```\n\n## Built-in error types\n\n### `notFound`: Not Found\n```javascript\n{status: 404, type: 'not_found'}\n```\n\n### `methodNotAllowed`: Method Not Allowed\n```javascript\n{status: 405, type: 'method_not_allowed'}\n```\n\n### `missingRequiredParameters`: Missing Required Parameters\n```javascript\n{status: 400, type: 'missing_required_parameters'}\n```\n\n### `invalidInput`: Invalid Input\n```javascript\n{status: 400, type: 'invalid_input'}\n```\n\n### `typeError`: Type Error\n```javascript\n{status: 400, type: 'type_error', class: TypeError}\n```\n\n### `unauthorized`: Unauthorized\n```javascript\n{status: 401, type: 'unauthorized'}\n```\n\n### `rateLimitExceeded`: Rate Limit Exceeded\n```javascript\n{status: 429, type: 'rate_limit_exceeded'}\n```\n\n### `fatalError`: Fatal Error\n```javascript\n{status: 500, type: 'fatal_error', stack: true}\n```\n","maintainers":[{"email":"t@hom.as","name":"thomaslindstr_m"}],"time":{"modified":"2022-06-12T14:39:47.921Z","created":"2016-12-05T22:39:37.816Z","1.0.0":"2016-12-05T22:39:37.816Z","1.0.1":"2016-12-05T22:46:37.542Z","1.0.2":"2016-12-14T13:21:28.173Z","1.0.4":"2016-12-14T14:30:43.406Z","1.0.3":"2016-12-14T15:29:00.621Z","1.0.5":"2017-01-05T14:46:07.025Z","1.0.6":"2017-08-06T01:08:00.737Z","1.0.7":"2017-08-06T01:10:30.646Z","2.0.0":"2017-09-20T23:57:35.887Z"},"homepage":"https://gitlab.com/thomaslindstr_m/modules#README","repository":{"type":"git","url":"git+ssh://git@gitlab.com/thomaslindstr_m/modules.git"},"author":{"name":"Thomas Lindstrøm","email":"t@hom.as"},"bugs":{"url":"https://gitlab.com/thomaslindstr_m/modules/issues"},"license":"ISC","readmeFilename":"README.md"}