{"_id":"@fastify/error","_rev":"22-de02f0288831208984e16e6f005f776b","name":"@fastify/error","dist-tags":{"latest":"4.2.0"},"versions":{"2.0.0":{"name":"@fastify/error","version":"2.0.0","keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","_id":"@fastify/error@2.0.0","maintainers":[{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"ethan_arrowood","email":"ethan@arrowood.dev"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"davidmarkclements","email":"david.mark.clements@gmail.com"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"dist":{"shasum":"a9f94af56eb934f0ab1ce4ef9f0ced6ebf2319dc","tarball":"https://registry.npmjs.org/@fastify/error/-/error-2.0.0.tgz","fileCount":9,"integrity":"sha512-wI3fpfDT0t7p8E6dA2eTECzzOd+bZsZCJ2Hcv+Onn2b7ZwK3RwD27uW2QDaMtQhAfWQQP+WNK7nKf0twLsBf9w==","signatures":[{"sig":"MEUCIQDztKVfarPFAdYSNaSJO4syjwbq0rqJuw+JbzCFw7fRWQIgRP3bSLfi68SrePrpeX4aGK/qIgfcvf1uEOIbRgg4e4o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaUodACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoyVw//bRuWug9lHBk4sr7lGnmBiHQ8MmAsORueVHgOpDnU/xfWyVg1\r\nF1XDSMTSvMpPHsUUKrs0/p0H6bUfYmpKnLOFqOtQwUFOgU4NjQHgf9BbuIcU\r\nTdzl5ADSHQz6RpYaCX+pZkbtH4PNAfgeNEw4H+x1Kl8zWdXVAf/xRyWl4goB\r\naEDZrC32af4UDopRiSxqIZDvAAwNgWx55GIZr1fVqB5onAUKxB74cvIdln15\r\n2TTOaFxxsWVmRSygwgzRdTyHenwHgToHojgSURip4sU3luMXUoX8lvoq6F/7\r\nNGCuaCRuNJYjQyOIe6wAFwD7HSlOlS3F1mL3+Z5lh03P62OQb4njcr9AxXFw\r\n5x93Cx1qetCVzVVG3Ro0zRHqCAY+R4/rTgieNQhtHHwr1aNu88omDD7nQ+Vn\r\neWQcpQi4+HeK5TXYbnsD+zV7zoyJbNlLKQXglzPVewledX2zvpr2eTNDt/lG\r\nGbcJoSxC1SQlVAHnVcBome8dbZEQpc6gbdX5/I8I/CROQY2+eZ+h84fQjDQx\r\npFEVpswLXBdAaS+WH+8CZE9AGzBpyVlZwv7lHa7TEgRD8ZGYPD7kHmhNJkE3\r\nm+F2dFVoIN5iAYeVvI1arXWT9oepF1FGJpTAl219cl3KIPhhPeKpUt8DVDLf\r\nM0dBQH6IzbEO3a3xffR80ossBXn3Ts5YLTM=\r\n=1BOB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","types":"index.d.ts","gitHead":"87121e4ad3c9501bbd153deca36271a5e0520d4e","scripts":{"test":"standard && ava -v && tsd"},"_npmUser":{"name":"jsumners","email":"james.sumners@gmail.com"},"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"_npmVersion":"8.5.5","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","directories":{},"_nodeVersion":"16.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.9.0","tsd":"^0.20.0","standard":"^17.0.0","typescript":"^4.1.3","@types/node":"^17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/error_2.0.0_1651067421136_0.273719790762587","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"@fastify/error","version":"3.0.0","keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","_id":"@fastify/error@3.0.0","maintainers":[{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"ethan_arrowood","email":"ethan@arrowood.dev"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"davidmarkclements","email":"david.mark.clements@gmail.com"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"dist":{"shasum":"bfcb7b33cec0196413083a91ef2edc7b2c88455b","tarball":"https://registry.npmjs.org/@fastify/error/-/error-3.0.0.tgz","fileCount":9,"integrity":"sha512-dPRyT40GiHRzSCll3/Jn2nPe25+E1VXc9tDwRAIKwFCxd5Np5wzgz1tmooWG3sV0qKgrBibihVoCna2ru4SEFg==","signatures":[{"sig":"MEYCIQDvHHqOlhu5hgrNXmzts1vQ6afhkgqqm8eqHNakaLw5EgIhAMXCAxsZGHoK2EfOX1a/8GTrx74T1fsSxgDzxnNfm3T/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii5cmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoqWQ//ftvGPOq8ImbZ4sC3osZj+rOXz+209B4SAXTTs0TVPXSdnIUd\r\nL+LAzhPdygrB4HN5BKlUtY6MdgWQTQ0yCBJA+uiC6vmF2utiG0+SjoJQXg0N\r\nR4gGTxG8+k/9GRb9gAxhcyK0ylWF8A2TBreIyGSV/uLLq6gFQbgAOiS8ZPtr\r\nIlif4/e83STclHMxIMpEdS4HG3pr7I91x1uylIaPr+YTm8DHe6MzJWffvMuX\r\nsw2qTaUL7cIi3+hxfLURU892QaHdENYp/xzsi9IGewwNWqrl1uya6r1EIZPe\r\nCYCkXmRpMV35SC6DmtK0/w4EdkpdWa0birRvdyugkI0MHqHi0NUZX7LKs6FE\r\nop8uX9CwDJ9uPK/Le+asDltCPNzbVxrTkW5OPenN8ZTsPFv0rr1sRYec/W07\r\nyCcIp8PVR4xe+r0OLbQOTPSgjghEk1C+Nfv8KTiQMZ4AdzBZr3Dpc/7J9sQw\r\nzbTVN/PEF0X3/pk1GBZEkk7aUuvNXRf0Gq/ZRQvP3rx4eSe5zynHPxlQe43L\r\nfN5Hn2JU+PWDByLNpWC+jErzIZutEA9IcH5KwB1D+xJqpMU1ydL8PmMdV47c\r\ne3c1dm9cqAj1M88xQO2jGHMczg+OR6uQh1MrSYexxEXuLyR26iFpDpgUUxCt\r\n8s+H/X8q+3BbhHvB7R5jZ0VYo/CP0AIvO5U=\r\n=gZ07\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","types":"index.d.ts","gitHead":"7aa465837afaaf3471002caa655c1b77fa2e37c2","scripts":{"test":"standard && ava -v && tsd"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"_npmVersion":"8.5.5","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","directories":{},"_nodeVersion":"16.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^4.0.1","tsd":"^0.20.0","standard":"^17.0.0","typescript":"^4.1.3","@types/node":"^17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/error_3.0.0_1653315366468_0.30642010499995354","host":"s3://npm-registry-packages"}},"3.1.0":{"name":"@fastify/error","version":"3.1.0","keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","_id":"@fastify/error@3.1.0","maintainers":[{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"davidmarkclements","email":"david.mark.clements@gmail.com"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"dist":{"shasum":"e29376f7ec522a8abecbe7dc04756e92089b73ae","tarball":"https://registry.npmjs.org/@fastify/error/-/error-3.1.0.tgz","fileCount":10,"integrity":"sha512-jmk3Q822+xi8jVzGsux3mWd+9O4rzVUGCqR2+JlF9LkCeeUmRdxPd2Je6S7IGMk5VTtB0xyB3crRQqklUyQ6dQ==","signatures":[{"sig":"MEQCIG78ArCOV2WK/QoES5PkWgXzzxL30OXRWfAwQ5b+F8bYAiAYBQq7LJRs3k1CuevetEKNhgyJ0BnDwDgBOvfAZpbniw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjipBxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpz5A//eQt7/rTtIwqfzKQBnGiLsSYxXrGLz+ii7lhLOxca6BtxW5wm\r\n4Ur+E/GnYvb40YZPsoo1E6Dtdo7lFGbdcxzI9DHPbuO/HcD/hEwmswSd7Uu+\r\nBSs+GQIoyoUwtznVF44y+vuqjGOJnWHNu4lZj4f7Usi+TNlH2V46nbuqXU2+\r\nrR2r4V20SouIQ6ibZ6PgMCx2M3LeGjmDEQNDvndWg6gF8u7tCe7ftYDVJcn4\r\nwBZnljJbW69ESObse+jzwMEshGocrKJf7MSixY7A+AubBuSYZw3LSVq9yfCk\r\nc9rbq3mf5Sc7kHoRux7hQtVlFU1pnczXEHNHr6XGiSFg9pT55wTD0dZFxArT\r\nWW3bdkTy6rE9MlUjANwNOm7S8sD+Iwkrg5JN8XecMvOb0F6A+hmutc3efPYv\r\nO0SwocLsuQ5eQ/m6yzgVj5hiauIzFGUc11Pk04J1SI3g6Nb3+h9t/zILuHYv\r\n75CWJdkAP0oezMDmUX5Npoedd7/CdSSyV6RwCbx5RLJ1NxTBL/xy6FTocWpo\r\nwA9L/0KIdVQJkWU9V6cQlIiVO5q17PJ4aBaHkm6ibMHC5+g+NW9QEwKnvjc9\r\nvrTeDEKbaD6ae/iCxDaVeS1tQhhE0EYDmEwOf7vqeGvhFNHtoR+gOWgToWkc\r\nne73LOrvYmjvrohiTkTPyDfto0Sw4prHdpk=\r\n=m0jc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","types":"types/index.d.ts","gitHead":"e4b4bd1aa0f4aa9914fd4fc0160d71a51bfcbf20","scripts":{"lint":"standard","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"_npmVersion":"9.1.2","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","directories":{},"_nodeVersion":"16.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.0","tsd":"^0.24.1","standard":"^17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/error_3.1.0_1670025329041_0.968876535294728","host":"s3://npm-registry-packages"}},"3.2.0":{"name":"@fastify/error","version":"3.2.0","keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","_id":"@fastify/error@3.2.0","maintainers":[{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"davidmarkclements","email":"david.mark.clements@gmail.com"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"dist":{"shasum":"9010e0acfe07965f5fc7d2b367f58f042d0f4106","tarball":"https://registry.npmjs.org/@fastify/error/-/error-3.2.0.tgz","fileCount":10,"integrity":"sha512-KAfcLa+CnknwVi5fWogrLXgidLic+GXnLjijXdpl8pvkvbXU5BGa37iZO9FGvsh9ZL4y+oFi5cbHBm5UOG+dmQ==","signatures":[{"sig":"MEYCIQCVILeQ47hq7IMOUeeI43gdIn5+nem33X5Cuk21DIQBWAIhAM8B4/lTNIBvx7LB8Y7sTJ+sh40WzN2vPsRMiPqfrQcx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkR/hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1hg//eFeFdBXofwLCeRi2Ej77erpofrnSb7I4Yi4EUnJPEtaRxfgu\r\nqPqTi51eLVheWjm5FM0amclMD/uEITPM+kfTBRGTT2XXVVsbldMVH8FkSt9C\r\nMW90FyWLVaJRbJCD7b1+lQ8He80NG1Lr4PiXZHr+aua8hW+Pzf9+UPbtJCPe\r\nUD1+/Dunt5MbSQ2V/c6ZY2NE4gAr0uMXFmgpDhkFOWicOmH3Ttn8NL6YqelJ\r\nl2vuE/GCY7CEjEx0q7DXPgWQBg3s8wACIKxXiwI9F91qovMJRcE/TlxQ1b5j\r\nEMGyv70wDy/eiKu0KKceN4n0/fTb31ET40yMdaLQlZABB+YMdwi809P933AT\r\nMRez3I+Qs8pB4mmFl2evNj+1ELqvK/d4maxFEaOpPXE6vpfUMOoPO/Q3iM2R\r\n0mv/IFDC416LXw9mZiL2rI6itOQgkb0tiXZ+FHe6884pJIPN2GXml1OBhVIT\r\no6sFOrrufXzBnsiFceyLBv9iPo2IBFT7wVvJhSMBSapA5e+vG/QCfMB9VekY\r\nCzGImW16sI4w30whafJ3gJfRG6+ngIO8W5xmIEoeaVwKf1d5Bn0gAZpA3KnI\r\n4Ne6/QpVyA2JiajjH08XvcWaYlIFXGpKGl9Hx2yJN5yiBU9GXMWaKD+pJr7M\r\nUni3T6ziTby3SjoXwY7Hlnxq3a9MBlr5HKY=\r\n=f84d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","types":"types/index.d.ts","gitHead":"392e798c2f7d86a8e9d02c90a773c190fe23a4eb","scripts":{"lint":"standard","test":"npm run test:unit && npm run test:typescript","test:unit":"tap","test:typescript":"tsd"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"_npmVersion":"9.1.2","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","directories":{},"_nodeVersion":"16.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.0","tsd":"^0.25.0","standard":"^17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/error_3.2.0_1670455265133_0.4616679981935232","host":"s3://npm-registry-packages"}},"3.2.1":{"name":"@fastify/error","version":"3.2.1","keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","_id":"@fastify/error@3.2.1","maintainers":[{"name":"metcoder95","email":"me@metcoder.dev"},{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"dist":{"shasum":"5d1cb182a8bb9b103c556b0da35fd77f319fc15e","tarball":"https://registry.npmjs.org/@fastify/error/-/error-3.2.1.tgz","fileCount":14,"integrity":"sha512-scZVbcpPNWw/yyFmzzO7cf1daTeJp53spN2n7dBTHZd+cV7791fcWJCPP1Tfhdbre+8vDiCyQyqqXfQnYMntYQ==","signatures":[{"sig":"MEUCIQDwVnFdqPivwjEjfKVSEBm9eS2I+AyBzW7kUxfC21xMQgIgZq8aZCTv65uCZJN65EtfqtFxa0H9y5Y9Km3h4+Gla0w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16535},"main":"index.js","types":"types/index.d.ts","gitHead":"137a6ebc75e72d5baf7f3faf25db24d3a5b95e03","scripts":{"lint":"standard","test":"npm run test:unit && npm run test:typescript","lint:fix":"standard --fix","test:unit":"tap","test:typescript":"tsd"},"_npmUser":{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"_npmVersion":"8.19.3","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","directories":{},"_nodeVersion":"18.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.0","tsd":"^0.28.0","standard":"^17.0.0","benchmark":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/error_3.2.1_1685772855013_0.3680947120361664","host":"s3://npm-registry-packages"}},"3.3.0":{"name":"@fastify/error","version":"3.3.0","keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","_id":"@fastify/error@3.3.0","maintainers":[{"name":"metcoder95","email":"me@metcoder.dev"},{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"dist":{"shasum":"eba790082e1144bfc8def0c2c8ef350064bc537b","tarball":"https://registry.npmjs.org/@fastify/error/-/error-3.3.0.tgz","fileCount":14,"integrity":"sha512-dj7vjIn1Ar8sVXj2yAXiMNCJDmS9MQ9XMlIecX2dIzzhjSHCyKo4DdXjXMs7wKW2kj6yvVRSpuQjOZ3YLrh56w==","signatures":[{"sig":"MEUCIEZrPCKRZLvw8fYTGrjs/I9UI03f1lgWW8ee9nesO5pEAiEAn7a0MViiOFrtLWLHlwZwo6rvP3YmyipeciguFOetkfs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16697},"main":"index.js","types":"types/index.d.ts","gitHead":"514cb8f1a0431b62f689acc4b845361b60d70af3","scripts":{"lint":"standard","test":"npm run test:unit && npm run test:typescript","lint:fix":"standard --fix","test:unit":"tap","test:typescript":"tsd"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"_npmVersion":"9.5.1","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","directories":{},"_nodeVersion":"18.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.0","tsd":"^0.28.0","standard":"^17.0.0","benchmark":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/error_3.3.0_1687528550962_0.4709038310436571","host":"s3://npm-registry-packages"}},"3.4.0":{"name":"@fastify/error","version":"3.4.0","keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","_id":"@fastify/error@3.4.0","maintainers":[{"name":"gurgunday","email":"gurgun.dayioglu@icloud.com"},{"name":"metcoder95","email":"me@metcoder.dev"},{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"dist":{"shasum":"30df6601f4edce57a05ec5caaa90a28025a8554a","tarball":"https://registry.npmjs.org/@fastify/error/-/error-3.4.0.tgz","fileCount":14,"integrity":"sha512-e/mafFwbK3MNqxUcFBLgHhgxsF8UT1m8aj0dAlqEa2nJEgPsRtpHTZ3ObgrgkZ2M1eJHPTwgyUl/tXkvabsZdQ==","signatures":[{"sig":"MEQCIHqKYfhQS/r3zqBHX/RmJwu/PzO0OZG/t4p8fgqYTpFRAiADiROX8MTNxXGshnElvBegEdpyRKLxsqKN6LEyQeM0cA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18096},"main":"index.js","types":"types/index.d.ts","gitHead":"97a294781eb335b79d996c69fc70126faa0131e9","scripts":{"lint":"standard","test":"npm run test:unit && npm run test:typescript","lint:fix":"standard --fix","test:unit":"tap","test:typescript":"tsd"},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"_npmVersion":"9.6.7","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","directories":{},"_nodeVersion":"18.17.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.0","tsd":"^0.29.0","standard":"^17.0.0","benchmark":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/error_3.4.0_1696330951036_0.5568816200020701","host":"s3://npm-registry-packages"}},"3.4.1":{"name":"@fastify/error","version":"3.4.1","keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","_id":"@fastify/error@3.4.1","maintainers":[{"name":"gurgunday","email":"gurgun.dayioglu@icloud.com"},{"name":"metcoder95","email":"me@metcoder.dev"},{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"}],"homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"dist":{"shasum":"b14bb4cac3dd4ec614becbc643d1511331a6425c","tarball":"https://registry.npmjs.org/@fastify/error/-/error-3.4.1.tgz","fileCount":15,"integrity":"sha512-wWSvph+29GR783IhmvdwWnN4bUxTD01Vm5Xad4i7i1VuAOItLvbPAb69sb0IQ2N57yprvhNIwAP5B6xfKTmjmQ==","signatures":[{"sig":"MEUCIQCZrhD+OZmmG/XtI+oVpZYnYdVO+tlxKvkkmhVPOH5FnAIgEW0Mqs6V2efh0BVsgVDpgQG6W4MKuQFfBKynpPCuxvQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18460},"main":"index.js","type":"commonjs","types":"types/index.d.ts","gitHead":"a6ca31bf593eecfae11b694f709a1179ec5311cf","scripts":{"lint":"standard","test":"npm run test:unit && npm run test:typescript","lint:fix":"standard --fix","test:unit":"tap","test:typescript":"tsd"},"_npmUser":{"name":"jsumners","email":"james.sumners@gmail.com"},"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"_npmVersion":"9.8.1","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","directories":{},"_nodeVersion":"18.18.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.0","tsd":"^0.29.0","standard":"^17.0.0","benchmark":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/error_3.4.1_1699100330090_0.2841570415063941","host":"s3://npm-registry-packages"}},"4.0.0":{"name":"@fastify/error","version":"4.0.0","keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","_id":"@fastify/error@4.0.0","homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"dist":{"shasum":"7842d6161fbce78953638318be99033a0c2d5070","tarball":"https://registry.npmjs.org/@fastify/error/-/error-4.0.0.tgz","fileCount":15,"integrity":"sha512-OO/SA8As24JtT1usTUTKgGH7uLvhfwZPwlptRi2Dp5P4KKmJI3gvsZ8MIHnNwDs4sLf/aai5LzTyl66xr7qMxA==","signatures":[{"sig":"MEYCIQCSH9b/bRoqp7B8zFIt9hxkQK9y9ccJHJ5q1ThiWC1jRAIhANN3xue9cItcGMwCHyc4rkAeiv8NVAJfs4jbqWE/hnks","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18464},"main":"index.js","type":"commonjs","types":"types/index.d.ts","gitHead":"316bebea2b8625ba7974376202950e86cef5bcfa","scripts":{"lint":"standard","test":"npm run test:unit && npm run test:typescript","lint:fix":"standard --fix","test:unit":"tap","test:typescript":"tsd"},"_npmUser":{"name":"jsumners","email":"james.sumners@gmail.com"},"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"_npmVersion":"10.7.0","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","directories":{},"_nodeVersion":"20.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^18.7.1","tsd":"^0.31.0","standard":"^17.1.0","benchmark":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/error_4.0.0_1718999240861_0.650744188107683","host":"s3://npm-registry-packages"}},"4.1.0":{"name":"@fastify/error","version":"4.1.0","keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","_id":"@fastify/error@4.1.0","maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"gurgunday","email":"hey@gurgun.day"},{"name":"metcoder95","email":"me@metcoder.dev"}],"contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"url":"https://james.sumners.info","name":"James Sumners"},{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},{"url":"https://github.com/fdawgs","name":"Frazer Smith","email":"frazer.dev@icloud.com"}],"homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"dist":{"shasum":"a6a3a8d2309bd8d3441512dff9a7c739d0c35fe2","tarball":"https://registry.npmjs.org/@fastify/error/-/error-4.1.0.tgz","fileCount":15,"integrity":"sha512-KeFcciOr1eo/YvIXHP65S94jfEEqn1RxTRBT1aJaHxY5FK0/GDXYozsQMMWlZoHgi8i0s+YtrLsgj/JkUUjSkQ==","signatures":[{"sig":"MEYCIQCzu01vXLi4rfOWTSJhVYDVn7YYLZWwNi44diOfRADDlgIhALzva59rh0jYdpj2+co/5byrTjJaUAs2Hj2DU2g1fgFM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21651},"main":"index.js","type":"commonjs","types":"types/index.d.ts","funding":[{"url":"https://github.com/sponsors/fastify","type":"github"},{"url":"https://opencollective.com/fastify","type":"opencollective"}],"gitHead":"a8c274c416da0ecdd367901cbe309600288d4585","scripts":{"lint":"eslint","test":"npm run test:unit && npm run test:typescript","lint:fix":"eslint --fix","test:unit":"c8 --100 node --test","test:typescript":"tsd"},"_npmUser":{"name":"gurgunday","email":"hey@gurgun.day"},"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"_npmVersion":"10.9.2","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.2","tsd":"^0.31.0","eslint":"^9.17.0","benchmark":"^2.1.4","neostandard":"^0.12.0"},"_npmOperationalInternal":{"tmp":"tmp/error_4.1.0_1741804741919_0.22208424351399514","host":"s3://npm-registry-packages-npm-production"}},"4.2.0":{"name":"@fastify/error","version":"4.2.0","keywords":["fastify","error","utility","plugin"],"author":{"name":"Tomas Della Vedova"},"license":"MIT","_id":"@fastify/error@4.2.0","maintainers":[{"name":"starptech","email":"deusdustin@gmail.com"},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"coopflow","email":"community@coopflow.com"},{"name":"delvedor","email":"tommydelved@gmail.com"},{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"allevo","email":"tomallevi@gmail.com"},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"zekth","email":"vince.legoff@gmail.com"},{"name":"rafaelgss","email":"rafael.nunu@hotmail.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fox1t","email":"maksim@sinik.it"},{"name":"airhorns","email":"harry@harry.me"},{"name":"kibertoad","email":"iselwin@gmail.com"},{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"galvez","email":"jonasgalvez@gmail.com"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"gurgunday","email":"hey@gurgun.day"},{"name":"metcoder95","email":"me@metcoder.dev"},{"name":"ivan-tymoshenko","email":"ivan@tymoshenko.me"},{"name":"fdawgs","email":"frazer.dev@icloud.com"}],"contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"url":"https://james.sumners.info","name":"James Sumners"},{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},{"url":"https://github.com/fdawgs","name":"Frazer Smith","email":"frazer.dev@icloud.com"}],"homepage":"https://github.com/fastify/fastify-error#readme","bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"tsd":{"compilerOptions":{"esModuleInterop":true}},"dist":{"shasum":"d40f46ba75f541fdcc4dc276b7308bbc8e8e6d7a","tarball":"https://registry.npmjs.org/@fastify/error/-/error-4.2.0.tgz","fileCount":16,"integrity":"sha512-RSo3sVDXfHskiBZKBPRgnQTtIqpi/7zhJOEmAxCiBcM7d0uwdGdxLlsCaLzGs8v8NnxIRlfG0N51p5yFaOentQ==","signatures":[{"sig":"MEUCIQDXBKm0Jdx9VCvyfDwkd+PHum2O1B8BH/bbZtGizJKTEgIgSQ50zfQCJIRGCcL9qKvgrTq6GaOow5N5PJrqNALwRRA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36872},"main":"index.js","type":"commonjs","types":"types/index.d.ts","funding":[{"url":"https://github.com/sponsors/fastify","type":"github"},{"url":"https://opencollective.com/fastify","type":"opencollective"}],"gitHead":"3b27b7600007a85ff5c1acac5a3254be27cb6f51","scripts":{"lint":"eslint","test":"npm run test:unit && npm run test:typescript","lint:fix":"eslint --fix","test:unit":"c8 --100 node --test","test:typescript":"tsd"},"_npmUser":{"name":"eomm","email":"behemoth89@gmail.com"},"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"_npmVersion":"10.9.0","description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","directories":{},"_nodeVersion":"22.10.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.2","tsd":"^0.32.0","eslint":"^9.17.0","benchmark":"^2.1.4","neostandard":"^0.12.0"},"_npmOperationalInternal":{"tmp":"tmp/error_4.2.0_1748764574381_0.7383941785867789","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2022-04-27T13:50:21.065Z","modified":"2026-03-05T20:02:01.108Z","2.0.0":"2022-04-27T13:50:21.339Z","3.0.0":"2022-05-23T14:16:06.598Z","3.1.0":"2022-12-02T23:55:29.214Z","3.2.0":"2022-12-07T23:21:05.300Z","3.2.1":"2023-06-03T06:14:15.188Z","3.3.0":"2023-06-23T13:55:51.110Z","3.4.0":"2023-10-03T11:02:31.184Z","3.4.1":"2023-11-04T12:18:50.301Z","4.0.0":"2024-06-21T19:47:21.045Z","4.1.0":"2025-03-12T18:39:02.128Z","4.2.0":"2025-06-01T07:56:14.569Z"},"bugs":{"url":"https://github.com/fastify/fastify-error/issues"},"author":{"name":"Tomas Della Vedova"},"license":"MIT","homepage":"https://github.com/fastify/fastify-error#readme","keywords":["fastify","error","utility","plugin"],"repository":{"url":"git+https://github.com/fastify/fastify-error.git","type":"git"},"description":"A small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.","contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"url":"https://james.sumners.info","name":"James Sumners"},{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},{"url":"https://github.com/fdawgs","name":"Frazer Smith","email":"frazer.dev@icloud.com"}],"maintainers":[{"email":"simone.busoli@gmail.com","name":"simoneb"},{"email":"tommydelved@gmail.com","name":"delvedor"},{"email":"hello@matteocollina.com","name":"matteo.collina"},{"email":"james.sumners@gmail.com","name":"jsumners"},{"email":"vince.legoff@gmail.com","name":"zekth"},{"email":"behemoth89@gmail.com","name":"eomm"},{"email":"maksim@sinik.it","name":"fox1t"},{"email":"harry@harry.me","name":"airhorns"},{"email":"iselwin@gmail.com","name":"kibertoad"},{"email":"kaka@kakawebsitedemo.com","name":"climba03003"},{"email":"jonasgalvez@gmail.com","name":"galvez"},{"email":"sbekkhus91@gmail.com","name":"simenb"},{"email":"hey@gurgun.day","name":"gurgunday"},{"email":"a.tripodi133@gmail.com","name":"tony133"},{"email":"me@metcoder.dev","name":"metcoder95"},{"email":"jean.antoine.michelet@gmail.com","name":"jean-michelet"},{"email":"ivan@tymoshenko.me","name":"ivan-tymoshenko"},{"email":"frazer.dev@icloud.com","name":"fdawgs"}],"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","readmeFilename":"README.md"}