{"_id":"@fastify/error","_rev":"4091670","name":"@fastify/error","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","dist-tags":{"latest":"4.2.0"},"maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"time":{"modified":"2025-12-02T22:23:08.000Z","created":"2022-04-27T13:50:21.339Z","4.2.0":"2025-06-01T07:56:14.569Z","4.1.0":"2025-03-12T18:39:02.128Z","4.0.0":"2024-06-21T19:47:21.045Z","3.4.1":"2023-11-04T12:18:50.301Z","3.4.0":"2023-10-03T11:02:31.184Z","3.3.0":"2023-06-23T13:55:51.110Z","3.2.1":"2023-06-03T06:14:15.188Z","3.2.0":"2022-12-07T23:21:05.300Z","3.1.0":"2022-12-02T23:55:29.214Z","3.0.0":"2022-05-23T14:16:06.598Z","2.0.0":"2022-04-27T13:50:21.339Z"},"users":{},"author":{"name":"Tomas Della Vedova"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"versions":{"4.2.0":{"name":"@fastify/error","version":"4.2.0","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","main":"index.js","type":"commonjs","types":"types/index.d.ts","scripts":{"lint":"eslint","lint:fix":"eslint --fix","test":"npm run test:unit && npm run test:typescript","test:unit":"c8 --100 node --test","test:typescript":"tsd"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"name":"James Sumners","url":"https://james.sumners.info"},{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},{"name":"Frazer Smith","email":"frazer.dev@icloud.com","url":"https://github.com/fdawgs"}],"license":"MIT","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"homepage":"https://github.com/fastify/fastify-error#readme","funding":[{"type":"github","url":"https://github.com/sponsors/fastify"},{"type":"opencollective","url":"https://opencollective.com/fastify"}],"devDependencies":{"benchmark":"^2.1.4","c8":"^10.1.2","eslint":"^9.17.0","neostandard":"^0.12.0","tsd":"^0.32.0"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"publishConfig":{"access":"public"},"_id":"@fastify/error@4.2.0","gitHead":"3b27b7600007a85ff5c1acac5a3254be27cb6f51","_nodeVersion":"22.10.0","_npmVersion":"10.9.0","dist":{"shasum":"d40f46ba75f541fdcc4dc276b7308bbc8e8e6d7a","size":7928,"noattachment":false,"key":"/@fastify/error/-/@fastify/error-4.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fastify/error/download/@fastify/error-4.2.0.tgz"},"_npmUser":{"name":"eomm","email":"behemoth89@gmail.com"},"directories":{},"maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/error_4.2.0_1748764574381_0.7383941785867789"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-06-01T07:56:14.569Z","publish_time":1748764574569,"_source_registry_name":"default","_cnpm_publish_time":1748764574569},"4.1.0":{"name":"@fastify/error","version":"4.1.0","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","main":"index.js","type":"commonjs","types":"types/index.d.ts","scripts":{"lint":"eslint","lint:fix":"eslint --fix","test":"npm run test:unit && npm run test:typescript","test:unit":"c8 --100 node --test","test:typescript":"tsd"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"name":"James Sumners","url":"https://james.sumners.info"},{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},{"name":"Frazer Smith","email":"frazer.dev@icloud.com","url":"https://github.com/fdawgs"}],"license":"MIT","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"homepage":"https://github.com/fastify/fastify-error#readme","funding":[{"type":"github","url":"https://github.com/sponsors/fastify"},{"type":"opencollective","url":"https://opencollective.com/fastify"}],"devDependencies":{"benchmark":"^2.1.4","c8":"^10.1.2","eslint":"^9.17.0","neostandard":"^0.12.0","tsd":"^0.31.0"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"publishConfig":{"access":"public"},"_id":"@fastify/error@4.1.0","gitHead":"a8c274c416da0ecdd367901cbe309600288d4585","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"shasum":"a6a3a8d2309bd8d3441512dff9a7c739d0c35fe2","size":5266,"noattachment":false,"key":"/@fastify/error/-/@fastify/error-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fastify/error/download/@fastify/error-4.1.0.tgz"},"_npmUser":{"name":"gurgunday","email":"hey@gurgun.day"},"directories":{},"maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/error_4.1.0_1741804741919_0.22208424351399514"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-03-12T18:39:02.128Z","publish_time":1741804742128,"_source_registry_name":"default","_cnpm_publish_time":1741804742128},"4.0.0":{"name":"@fastify/error","version":"4.0.0","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","main":"index.js","type":"commonjs","types":"types/index.d.ts","scripts":{"lint":"standard","lint:fix":"standard --fix","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"homepage":"https://github.com/fastify/fastify-error#readme","devDependencies":{"benchmark":"^2.1.4","standard":"^17.1.0","tap":"^18.7.1","tsd":"^0.31.0"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"publishConfig":{"access":"public"},"_id":"@fastify/error@4.0.0","gitHead":"316bebea2b8625ba7974376202950e86cef5bcfa","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"shasum":"7842d6161fbce78953638318be99033a0c2d5070","size":4781,"noattachment":false,"key":"/@fastify/error/-/@fastify/error-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fastify/error/download/@fastify/error-4.0.0.tgz"},"_npmUser":{"name":"jsumners","email":"james.sumners@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/error_4.0.0_1718999240861_0.650744188107683"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-06-21T19:47:21.045Z","publish_time":1718999241045,"_source_registry_name":"default","maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_cnpm_publish_time":1718999241045},"3.4.1":{"name":"@fastify/error","version":"3.4.1","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","main":"index.js","type":"commonjs","types":"types/index.d.ts","scripts":{"lint":"standard","lint:fix":"standard --fix","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"homepage":"https://github.com/fastify/fastify-error#readme","devDependencies":{"benchmark":"^2.1.4","standard":"^17.0.0","tap":"^16.0.0","tsd":"^0.29.0"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"publishConfig":{"access":"public"},"_id":"@fastify/error@3.4.1","gitHead":"a6ca31bf593eecfae11b694f709a1179ec5311cf","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"shasum":"b14bb4cac3dd4ec614becbc643d1511331a6425c","size":4775,"noattachment":false,"key":"/@fastify/error/-/@fastify/error-3.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fastify/error/download/@fastify/error-3.4.1.tgz"},"_npmUser":{"name":"jsumners","email":"james.sumners@gmail.com"},"directories":{},"maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/error_3.4.1_1699100330090_0.2841570415063941"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-04T12:18:50.301Z","publish_time":1699100330301,"_source_registry_name":"default","_cnpm_publish_time":1699100330301},"3.4.0":{"name":"@fastify/error","version":"3.4.0","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","main":"index.js","types":"types/index.d.ts","scripts":{"lint":"standard","lint:fix":"standard --fix","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"homepage":"https://github.com/fastify/fastify-error#readme","devDependencies":{"benchmark":"^2.1.4","standard":"^17.0.0","tap":"^16.0.0","tsd":"^0.29.0"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"publishConfig":{"access":"public"},"gitHead":"97a294781eb335b79d996c69fc70126faa0131e9","_id":"@fastify/error@3.4.0","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"shasum":"30df6601f4edce57a05ec5caaa90a28025a8554a","size":4662,"noattachment":false,"key":"/@fastify/error/-/@fastify/error-3.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fastify/error/download/@fastify/error-3.4.0.tgz"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"directories":{},"maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/error_3.4.0_1696330951036_0.5568816200020701"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-03T11:02:31.184Z","publish_time":1696330951184,"_source_registry_name":"default","_cnpm_publish_time":1696330951184},"3.3.0":{"name":"@fastify/error","version":"3.3.0","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","main":"index.js","types":"types/index.d.ts","scripts":{"lint":"standard","lint:fix":"standard --fix","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"homepage":"https://github.com/fastify/fastify-error#readme","devDependencies":{"benchmark":"^2.1.4","standard":"^17.0.0","tap":"^16.0.0","tsd":"^0.28.0"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"publishConfig":{"access":"public"},"gitHead":"514cb8f1a0431b62f689acc4b845361b60d70af3","_id":"@fastify/error@3.3.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"shasum":"eba790082e1144bfc8def0c2c8ef350064bc537b","size":4442,"noattachment":false,"key":"/@fastify/error/-/@fastify/error-3.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fastify/error/download/@fastify/error-3.3.0.tgz"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"directories":{},"maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/error_3.3.0_1687528550962_0.4709038310436571"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-06-23T13:55:51.110Z","publish_time":1687528551110,"_source_registry_name":"default","_cnpm_publish_time":1687528551110},"3.2.1":{"name":"@fastify/error","version":"3.2.1","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","main":"index.js","types":"types/index.d.ts","scripts":{"lint":"standard","lint:fix":"standard --fix","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"homepage":"https://github.com/fastify/fastify-error#readme","devDependencies":{"benchmark":"^2.1.4","standard":"^17.0.0","tap":"^16.0.0","tsd":"^0.28.0"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"publishConfig":{"access":"public"},"gitHead":"137a6ebc75e72d5baf7f3faf25db24d3a5b95e03","_id":"@fastify/error@3.2.1","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"shasum":"5d1cb182a8bb9b103c556b0da35fd77f319fc15e","size":4378,"noattachment":false,"key":"/@fastify/error/-/@fastify/error-3.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fastify/error/download/@fastify/error-3.2.1.tgz"},"_npmUser":{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},"directories":{},"maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/error_3.2.1_1685772855013_0.3680947120361664"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-06-03T06:14:15.188Z","publish_time":1685772855188,"_source_registry_name":"default","_cnpm_publish_time":1685772855188},"3.2.0":{"name":"@fastify/error","version":"3.2.0","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","main":"index.js","types":"types/index.d.ts","scripts":{"lint":"standard","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"homepage":"https://github.com/fastify/fastify-error#readme","devDependencies":{"standard":"^17.0.0","tap":"^16.0.0","tsd":"^0.25.0"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"publishConfig":{"access":"public"},"gitHead":"392e798c2f7d86a8e9d02c90a773c190fe23a4eb","_id":"@fastify/error@3.2.0","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"shasum":"9010e0acfe07965f5fc7d2b367f58f042d0f4106","size":3620,"noattachment":false,"key":"/@fastify/error/-/@fastify/error-3.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fastify/error/download/@fastify/error-3.2.0.tgz"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"directories":{},"maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/error_3.2.0_1670455265133_0.4616679981935232"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-12-07T23:29:22.409Z","publish_time":1670455265300,"_cnpm_publish_time":1670455265300},"3.1.0":{"name":"@fastify/error","version":"3.1.0","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","main":"index.js","types":"types/index.d.ts","scripts":{"lint":"standard","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"homepage":"https://github.com/fastify/fastify-error#readme","devDependencies":{"standard":"^17.0.0","tap":"^16.0.0","tsd":"^0.24.1"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"publishConfig":{"access":"public"},"gitHead":"e4b4bd1aa0f4aa9914fd4fc0160d71a51bfcbf20","_id":"@fastify/error@3.1.0","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"shasum":"e29376f7ec522a8abecbe7dc04756e92089b73ae","size":3504,"noattachment":false,"key":"/@fastify/error/-/@fastify/error-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fastify/error/download/@fastify/error-3.1.0.tgz"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"directories":{},"maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/error_3.1.0_1670025329041_0.968876535294728"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-12-02T23:55:34.272Z","publish_time":1670025329214,"_cnpm_publish_time":1670025329214},"3.0.0":{"name":"@fastify/error","version":"3.0.0","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","main":"index.js","types":"index.d.ts","scripts":{"test":"standard && ava -v && tsd"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"homepage":"https://github.com/fastify/fastify-error#readme","devDependencies":{"@types/node":"^17.0.0","ava":"^4.0.1","standard":"^17.0.0","tsd":"^0.20.0","typescript":"^4.1.3"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"publishConfig":{"access":"public"},"gitHead":"7aa465837afaaf3471002caa655c1b77fa2e37c2","_id":"@fastify/error@3.0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"shasum":"bfcb7b33cec0196413083a91ef2edc7b2c88455b","size":3330,"noattachment":false,"key":"/@fastify/error/-/@fastify/error-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fastify/error/download/@fastify/error-3.0.0.tgz"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"directories":{},"maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/error_3.0.0_1653315366468_0.30642010499995354"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-05-23T15:45:44.525Z","publish_time":1653315366598,"_cnpm_publish_time":1653315366598},"2.0.0":{"name":"@fastify/error","version":"2.0.0","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","main":"index.js","types":"index.d.ts","scripts":{"test":"standard && ava -v && tsd"},"repository":{"type":"git","url":"git+https://github.com/fastify/fastify-error.git"},"keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"homepage":"https://github.com/fastify/fastify-error#readme","devDependencies":{"@types/node":"^17.0.0","ava":"^3.9.0","standard":"^17.0.0","tsd":"^0.20.0","typescript":"^4.1.3"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"publishConfig":{"access":"public"},"gitHead":"87121e4ad3c9501bbd153deca36271a5e0520d4e","_id":"@fastify/error@2.0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"shasum":"a9f94af56eb934f0ab1ce4ef9f0ced6ebf2319dc","size":3607,"noattachment":false,"key":"/@fastify/error/-/@fastify/error-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fastify/error/download/@fastify/error-2.0.0.tgz"},"_npmUser":{"name":"jsumners","email":"james.sumners@gmail.com"},"directories":{},"maintainers":[{"name":"airhorns","email":"harry@harry.me"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"delvedor","email":""},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"fox1t","email":""},{"name":"galvez","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jean-michelet","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"tony133","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/error_2.0.0_1651067421136_0.273719790762587"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-27T14:43:47.086Z","publish_time":1651067421339,"_cnpm_publish_time":1651067421339}},"readme":"# @fastify/error\n\n[![CI](https://github.com/fastify/fastify-error/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/fastify-error/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/@fastify/error.svg?style=flat)](https://www.npmjs.com/package/@fastify/error)\n[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)\n\nA small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.\n\n### Install\n```\nnpm i @fastify/error\n```\n\n### Usage\n\nThe module exports a function that you can use for consistent error objects, it takes 4 parameters:\n\n```js\ncreateError(code, message [, statusCode [, Base [, captureStackTrace]]])\n```\n\n- `code` (`string`, required) - The error code, you can access it later with `error.code`. For consistency, we recommend prefixing plugin error codes with `FST_`\n- `message` (`string`, required) - The error message. You can also use interpolated strings for formatting the message.\n- `statusCode` (`number`, optional) - The status code that Fastify will use if the error is sent via HTTP.\n- `Base` (`ErrorConstructor`, optional) - The base error object that will be used. (eg `TypeError`, `RangeError`)\n- `captureStackTrace` (`boolean`, optional) - Whether to capture the stack trace or not.\n\n```js\nconst createError = require('@fastify/error')\nconst CustomError = createError('ERROR_CODE', 'Hello')\nconsole.log(new CustomError()) // error.message => 'Hello'\n```\n\nHow to use an interpolated string:\n```js\nconst createError = require('@fastify/error')\nconst CustomError = createError('ERROR_CODE', 'Hello %s')\nconsole.log(new CustomError('world')) // error.message => 'Hello world'\n```\n\nHow to add cause:\n```js\nconst createError = require('@fastify/error')\nconst CustomError = createError('ERROR_CODE', 'Hello %s')\nconsole.log(new CustomError('world', {cause: new Error('cause')}))\n// error.message => 'Hello world'\n// error.cause => Error('cause')\n```\n\n### TypeScript\n\nIt is possible to limit your error constructor with a generic type using TypeScript:\n\n```ts\nconst CustomError = createError<[string]>('ERROR_CODE', 'Hello %s')\nnew CustomError('world')\n//@ts-expect-error\nnew CustomError(1)\n```\n\n### instanceof\n\nAll errors created with `createError` will be instances of the base error constructor you provided, or `Error` if none was provided.\n\n```js\nconst createError = require('@fastify/error')\nconst CustomError = createError('ERROR_CODE', 'Hello %s', 500, TypeError)\nconst customError = new CustomError('world')\n\nconsole.log(customError instanceof CustomError) // true\nconsole.log(customError instanceof TypeError) // true\nconsole.log(customError instanceof Error) // true\n```\n\nAll instantiated errors are instances of the `FastifyError` class, which can be required directly from the module.\n\n```js\nconst { createError, FastifyError } = require('@fastify/error')\nconst CustomError = createError('ERROR_CODE', 'Hello %s', 500, TypeError)\nconst customError = new CustomError('world')\n\nconsole.log(customError instanceof FastifyError) // true\n```\n\nA `FastifyError` created by `createError` can extend another `FastifyError` while maintaining correct `instanceof` behavior.\n\n```js\nconst { createError, FastifyError } = require('@fastify/error')\n\nconst CustomError = createError('ERROR_CODE', 'Hello %s', 500, TypeError)\nconst ChildCustomError = createError('CHILD_ERROR_CODE', 'Hello %s', 500, CustomError)\n\nconst customError = new ChildCustomError('world')\n\nconsole.log(customError instanceof ChildCustomError) // true\nconsole.log(customError instanceof CustomError) // true\nconsole.log(customError instanceof FastifyError) // true\nconsole.log(customError instanceof TypeError) // true\nconsole.log(customError instanceof Error) // true\n```\n\nIf `fastify-error` is installed multiple times directly or as a transitive dependency, `instanceof` checks for errors created by `createError` will still work correctly across these installations, as long as their error codes (e.g., `FST_ERR_CUSTOM_ERROR`) are identical.\n\n```js\nconst { createError, FastifyError } = require('@fastify/error')\n\n// CustomError from `@fastify/some-plugin` is created with `createError` and\n// has its own `@fastify/error` installation as dependency. CustomError has\n// FST_ERR_CUSTOM_ERROR as code.\nconst { CustomError: CustomErrorFromPlugin } = require('@fastify/some-plugin')\n\nconst CustomError = createError('FST_ERR_CUSTOM_ERROR', 'Hello %s', 500)\n\nconst customError = new CustomError('world')\nconst customErrorFromPlugin = new CustomErrorFromPlugin('world')\n\nconsole.log(customError instanceof CustomError) // true\nconsole.log(customError instanceof CustomErrorFromPlugin) // true\nconsole.log(customErrorFromPlugin instanceof CustomError) // true\nconsole.log(customErrorFromPlugin instanceof CustomErrorFromPlugin) // true\n```\n\nChanging the code of an instantiated Error will not change the result of the `instanceof` operator.\n\n```js\nconst { createError, FastifyError } = require('@fastify/error')\n\nconst CustomError = createError('ERROR_CODE', 'Hello %s', 500, TypeError)\nconst AnotherCustomError = createError('ANOTHER_ERROR_CODE', 'Hello %s', 500, CustomError)\n\nconst customError = new CustomError('world')\ncustomError.code = 'ANOTHER_ERROR_CODE'\n\nconsole.log(customError instanceof CustomError) // true\nconsole.log(customError instanceof AnotherCustomError) // false\n```\n\n## License\n\nLicensed under [MIT](./LICENSE).\n","_attachments":{},"homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"license":"MIT"}