{"_id":"@dotcom-gosahi/centralized-exception-and-error-handling","_rev":"2-87103eab55044a41b3881ed7286dcd1d","name":"@dotcom-gosahi/centralized-exception-and-error-handling","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@dotcom-gosahi/centralized-exception-and-error-handling","version":"1.0.0","description":"Provide code for having a centralized system to handle exceptions and errors","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Astha"},"license":"ISC","dependencies":{"winston":"^3.3.3","winston-mongodb":"^5.0.7"},"gitHead":"8d3034cf7b9dcd46ec784a4bad6cebe2ca8bb12d","_id":"@dotcom-gosahi/centralized-exception-and-error-handling@1.0.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-GqYLjZbc/cFV6WvOv+e2Emd1CpFLxIi5D38uUKfYJHf8pOG0+uV6lLs4GFFIe3uC+ZcVbYQfjYVQiGjFZVOXNg==","shasum":"537089c66bad321536aafc45fb84c7f67462a2f1","tarball":"https://registry.npmjs.org/@dotcom-gosahi/centralized-exception-and-error-handling/-/centralized-exception-and-error-handling-1.0.0.tgz","fileCount":7,"unpackedSize":7207,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhILrxCRA9TVsSAnZWagAA04gQAKG7eAg1el9FBMFZf/Oh\nGTtpE36Ykscog8/8csepcW5NJ+/aaEnK3Kf2x76di6EnFh7paYxrnq9K07Bf\nKgA1K8SyNMNYhgttQk9TYjWmZKgKv02EnB57U8z6MRYhY7an8Ex6OYHAcNTP\nSnCPsrR/zzUpuVAFHdZ36v4+5xtts4v6a6F0SPx6/pY3QcY4m6rLMGcZzFZJ\nJeslaN480HP9IbrqqripL790tFeRrE2IBhc8e/R+lke7FzRtdLB0oWhie0ef\np4uujzIz7etSKcWeMswzDNbeuLFffmc0pP4hnbPuq3sunmJrqVsRdLSTEDtT\nIHYkR3o76Dt3+ljz9igGUflNE4ldtZ70FIObFA1vXr3VG8zu6CHDi4JXSWbp\n9RqD+8114VitygS8K0RAlfxkbNrg7cuErWnWMj3nKEuMNSzY0zRpuu6dqqSs\nHCGzVdZkmY5eI4ZWKMgzk8LJBrElV41tktz0kme6frsKZP+2x++ga9k5bTLn\nt3GoO83XY+faolEdfzhJCH01BlLMiCu5rINwS1zMrTOcjHgauXPt7t4i4cm+\njkBb5ejwhb51GTTNeaU8sTbp3aLaCQNvRsO5sf9Zpil6rV56Jb2PThLyPmmv\n5y8lEBGiHp8qrDE+Tqew6XI1b0VztnHOAf6TXy517RMg9EWevSLhBHIDR9x2\nirjr\r\n=wXTl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEj2UbUfedjCBfwI1Jin64Qrl7N9rHzkMSDDmPKTm/YAIhAKCCiN1d8A0tFE8mOhwy9R0N3Q3MPYvTSYatM3Hc1E2J"}]},"_npmUser":{"name":"dotcom-gosahi1","email":"dotcomgosahi5@gmail.com"},"directories":{},"maintainers":[{"name":"dotcom-gosahi1","email":"dotcomgosahi5@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/centralized-exception-and-error-handling_1.0.0_1629534961501_0.6489843109165216"},"_hasShrinkwrap":false},"1.0.1":{"name":"@dotcom-gosahi/centralized-exception-and-error-handling","version":"1.0.1","description":"Provide code for having a centralized system to handle exceptions and errors","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Astha"},"license":"ISC","keywords":["error-handling","exception","exception-handling","IndianAce"],"dependencies":{"winston":"^3.3.3","winston-mongodb":"^5.0.7"},"gitHead":"506642efcd70f73a464c7be7be2a74d652e39676","_id":"@dotcom-gosahi/centralized-exception-and-error-handling@1.0.1","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-84Hn3/YP4nMsbXqAzVUhF1MrguDZFHRREqYvcaZTdxZAC9fAApGu26SH5feCwt6yDIo3pNeZBBNv2w4JPvav7g==","shasum":"c3a40df4c1fdfcd9e97ce4f8c2b434136f5092b5","tarball":"https://registry.npmjs.org/@dotcom-gosahi/centralized-exception-and-error-handling/-/centralized-exception-and-error-handling-1.0.1.tgz","fileCount":7,"unpackedSize":7309,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhIM3cCRA9TVsSAnZWagAAed4QAJFHstnyMsrrGLrT7vBE\nsXyfz2NEAaOhHNvyy+ESQZwXZ2xgzEpH5Y0VtnJacvX5pkyD4Qz6e025UJlc\nYgbBubhpm/jUqA4smRsfqPxpkCdJIMLoE6JrSNUAUEkt5pvywVZJogW8qT0v\nWXTF3E6QNWuC+EQ5YybwEez2lX3RwTddM6KAuZQS/7Fy1n0K707hnzDCfkMo\nFzllSRg6GpQUeY7Mpt77m1A76386WgF35G0VyXKW2iIFLKFummZvUDsopORN\nZ6f0rfrCUOk/fo5/M+nGG5HjsCHgVSrMiw7mpE5499AZUeF+CF3bmjieh8Rc\n9Ljs24s3vN9HcKPeNn0YNG9DaZN0ZvtlH4t6E+XI8xFPJCACmnz6JLtqlmXi\np9CaVUtioWE3o7WwLVNtkcqI0RW24j4boA7jvJkhKqAFvvsfIl4GAl9fMhIP\nGWQEzDHYded40jsr08IFx4hCY97BBvaLbgZ3UMx9z0isa6irIiN9vRDP9UUV\nceLVNILv6y/nnWnKnuqUN0smwR1ISWz90P/eIM2Co49zmyKIKsGSoxiFe4uo\n7PPsX/qtvNYG8H7+uKo5JQogLTgRH2nMx20gDseiC3J5QmOcuxyh15fqWg4E\n31dY0jx3TYLROIJpMOKmTrnxgrYMTv+lfPY5ljmiPj1FuAmZav85QniH+G6E\nWqgl\r\n=0pKJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQS96Cuat3mzDGk4JOjDcOsDMMOtSSjhudKuhgBVHoSAiEArvc7V1Cs0fopkNpGFCLbLs3ZzaJ8T3dE36adSLmX3lg="}]},"_npmUser":{"name":"dotcom-gosahi1","email":"dotcomgosahi5@gmail.com"},"directories":{},"maintainers":[{"name":"dotcom-gosahi1","email":"dotcomgosahi5@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/centralized-exception-and-error-handling_1.0.1_1629539803918_0.6458411339424843"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-21T08:36:01.459Z","1.0.0":"2021-08-21T08:36:01.663Z","modified":"2022-04-05T05:27:52.290Z","1.0.1":"2021-08-21T09:56:44.110Z"},"maintainers":[{"name":"dotcom-gosahi1","email":"dotcomgosahi5@gmail.com"}],"description":"Provide code for having a centralized system to handle exceptions and errors","author":{"name":"Astha"},"license":"ISC","readme":"# What is this?\r\n\r\nIt a library for providing centralized error and exception handling with mongo DB. It is mainly used by Indian Aces Organization in their different projects.\r\n\r\n# Installation\r\n\r\n`npm i @dotcom-gosahi/centralized-exception-and-error-handling`\r\n\r\nThen...\r\n\r\n```\r\nconst errorHandler = require('@dotcom-gosahi/centralized-exception-and-error-handling');\r\n\r\napp.use(errorHandler(\r\n  {\r\n    environment: ENV,\r\n    configuration: {\r\n      connection: db,\r\n      errorDbName: error_db_Name\r\n    }\r\n  }));\r\n```\r\n\r\nThen...\r\n\r\n```\r\nconst { APIError, httpErrorCodes} = require('@dotcom-gosahi/centralized-exception-and-error-handling');\r\n\r\nres.status(httpErrorCodes.CREATED).json({ message: 'Inserted Successfully!' });\r\n\r\nnext(APIError.BadRequest(err.message));\r\n```\r\n\r\n## Options\r\n\r\nhttpErrorCodes has following error codes:\r\n    * OK\r\n    * CREATED\r\n    * BAD_REQUEST\r\n    * UNAUTHORIZED\r\n    * NOT_FOUND\r\n    * INTERNAL_SERVER\r\n    * UPDATED\r\n\r\n*Environments* - _LOCAL / TEST / DEV / PROD_\r\n\r\nAPIError has following methods:\r\n    * BadRequest\r\n    * UnathorisedRequest\r\n    * NotFoundRequest\r\n    * ServerError\r\n","readmeFilename":"README.md","keywords":["error-handling","exception","exception-handling","IndianAce"]}