{"_id":"@efi.shtain/try-catch-type","_rev":"5-8bae4db41f8a91468b81e3e80f029ced","name":"@efi.shtain/try-catch-type","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@efi.shtain/try-catch-type","version":"1.0.0","description":"","main":"src/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/efiShtain/try-catch-type.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/efiShtain/try-catch-type/issues"},"homepage":"https://github.com/efiShtain/try-catch-type#readme","gitHead":"17fdff37d3ead679dd622f5fabbc6c2afeae29d0","_id":"@efi.shtain/try-catch-type@1.0.0","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-FCPf4wOLvfT3MEhSPnIgNcz1R1JrDs0+Od6iKeXaDPwn7O8NSKlQt18qjbGhlOu5kjCldVPQUrMET/HbYbpnEQ==","shasum":"2391dd783120c1b19788682bc76bcb9ae46e2f3e","tarball":"https://registry.npmjs.org/@efi.shtain/try-catch-type/-/try-catch-type-1.0.0.tgz","fileCount":3,"unpackedSize":1713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2ohPCRA9TVsSAnZWagAAkP0QAKRV5NBtHdDnw6im4wNu\nffUelAbXUfFQh/ri7G/VXi74RRkCJHw9Xl1WqWgTIIUQI2IjC17wyBFHQShM\n/ySFp/+illQQzeG7dkWWSxxpqJ3YlCmg0La68r+OAUR5pv1QLfvL6chgd38v\n7z1KO6f8G9stW6o2NcsrLSlIlrSsd1uRcxtZ61NNQqwT9WWw92rqCFjdqFOY\nvYvqH3YI1kW0k8Jq4wQlBvtdS9/AqwTW3wNlAlaLwssUsl6MWqL5pCnOsyj1\njtLs1QOWxgoZfboP3wjo+KwC5gQvXJsXkmQ6vth8cbI2Mn9SByQatiSGokXO\nDIVLafuktVmM1V6iLqu0ZuHlzndt9BqpKcKeYnFHBoacTDyfEijBjgQjWh0W\n/cKXxrIsyF35YxpfAID8FCjHpP/gRTnu6cUzaHsz19g5CVjcXaNuch7tGgVV\nQjX6ns4fvKts+FYNvVjgAozhglIRX9r0aX3xKB9BblonR6tBU7H5I/uRusuU\nY4l3OR7Qch2FsOG9Lk8dbsj4H5Idm4yzHr/rESlJS/gE9lXVXf6uT2fWccbB\nNk3VhzoA6nxLiOrXGegh1U0hn4J87X2id2xijpBLhQzXsurEwc0HZzihVRfe\nZVCf76kjelJuJhEHTciMMSoCQHhePRX3/7jj49yU2k0toovu0xC4daxp7Oh6\n/qMV\r\n=lBJb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjy5nKu13IxOjdEjQjyKp2VUeQzUdhQerc8abpVju2KQIhAKPSWGXr+ra4rpacGZXZBcDs25O9XZxMIKaG9lLaR4uR"}]},"maintainers":[{"name":"efi.shtain","email":"efi.shtain@gmail.com"}],"_npmUser":{"name":"efi.shtain","email":"efi.shtain@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/try-catch-type_1.0.0_1574602830913_0.1916371918746178"},"_hasShrinkwrap":false},"1.0.1":{"name":"@efi.shtain/try-catch-type","version":"1.0.1","description":"async await brought try catch to asyncrounous javascript, problem is that it is ugly and verbose. Having to write lots of try catch blocks for fine grained error handling is not so much fun, and it makes the code harder to read.","main":"src/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/efiShtain/try-catch-type.git"},"keywords":["try","catch","type","exception"],"author":"","license":"ISC","bugs":{"url":"https://github.com/efiShtain/try-catch-type/issues"},"homepage":"https://github.com/efiShtain/try-catch-type#readme","gitHead":"a4c183320367cb92894ec57ad944f1bb6871f44d","_id":"@efi.shtain/try-catch-type@1.0.1","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-7BBIRXfDE4uG5kZDozSPwaOHr0T2GHHRuZzc6dvMjl3JvEDkmb/ZglfQrQ9lHXNddvBBtIGgUiCA5kH3/hWqpQ==","shasum":"5d8847537aa59f6d4c93fbe7a3ee8ce74af36cb3","tarball":"https://registry.npmjs.org/@efi.shtain/try-catch-type/-/try-catch-type-1.0.1.tgz","fileCount":4,"unpackedSize":3256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2o5HCRA9TVsSAnZWagAAPzYP/ivr0VdVPllY/HIq2oxn\nFY9iKgG3WutkqNvi0h3V7/N52o/N4QacB56Sl8QIpvM1Xbi70gTxP4S5f5mm\niMrY0jRYHRWu6iywUCX1IittGGuCd+CABdsP+xxPuQ8MMhq/g3kli4LLg1XX\nd4SL11E3ZG3qAtBzj7jYCUrmi7KZTaJfQYFJ+rwXNNMy/2MODj87VfihlV5c\nA69w3jY0VL8eT2GasjD+QY/iGWk6lRl7avkbBE12z8jF9+J1Z9WDRYwG7Ond\nXBJPd5Lzy0L4C8hIkuJxcPrXzHHcqUB5keFrJXl77MjVoWypjaUb6UXCPFoJ\noznzc+QP52Xwe2pEfFreK7hEszrah5Pv085PBZyXulAi95JR+m2ImOxsjG/N\ndDPjFvfoO30h34eF2mhr7QprMpbPG3qU4F5EPC7v2X8iIhHQqFkJSKHyP7jt\ndTtOaIqCCxiz8Wxg9gayPxKy2H7J/9baRdEsyEoquf85pagoh8nvZdh90g3q\nwZR9PeGAtLxumSxd4Nfmvzd1YKkUg+nEveeyaxA1WRvj17iqRQIUOCmKvCPU\n9A0jAHD77GlzslgDuBglTy2uT9vAyQtpaU6lWqVLVXP55jlK1BRJEtK188FT\nsWrekWPcK9LzUgF3+vwC6/x5E8lHnfhVd/F8cVK7KNm8i4Uv0iD9eIk/c+qY\ny0FX\r\n=Gr/5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAEh5GzHZpcjziuFTSCiA1JXos0ehV2CeI84/nxwzmFoAiEA/ZwbGFJBf6AzkfH3DxhVebmWHlYGdfAYPoQmYZjz6UA="}]},"maintainers":[{"name":"efi.shtain","email":"efi.shtain@gmail.com"}],"_npmUser":{"name":"efi.shtain","email":"efi.shtain@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/try-catch-type_1.0.1_1574604359052_0.5752087643973764"},"_hasShrinkwrap":false},"1.0.2":{"name":"@efi.shtain/try-catch-type","version":"1.0.2","description":"async await brought try catch to asyncrounous javascript, problem is that it is ugly and verbose. Having to write lots of try catch blocks for fine grained error handling is not so much fun, and it makes the code harder to read.","main":"src/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/efiShtain/try-catch-type.git"},"keywords":["try","catch","type","exception"],"author":"","license":"ISC","bugs":{"url":"https://github.com/efiShtain/try-catch-type/issues"},"homepage":"https://github.com/efiShtain/try-catch-type#readme","gitHead":"5c13474e40e5b073af3b91099c1ce2e7fe4dbb73","_id":"@efi.shtain/try-catch-type@1.0.2","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-NfapddEbUjfqvnVnJr7Y/sEaCe6jxmCnCZiK5AgaIpEOkoojjEtpkQ1pybOwceiIDCpsULW293CAag9EI3Y8LA==","shasum":"9dd962f06e5efab48263c3b040cc379189feb32a","tarball":"https://registry.npmjs.org/@efi.shtain/try-catch-type/-/try-catch-type-1.0.2.tgz","fileCount":4,"unpackedSize":3289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2pW1CRA9TVsSAnZWagAA9ecP/3hN0y6fC/VySN9zwGlC\ncBYaUSg57mlfe/wJhnB1AUhvqq7xFUfygyLyNEXT/voImgNDaJVSR4RAVlPf\n5PegEssJf5r54n29uOzsojESAjQXgT4Aed5iTICNDjVh1Qohk2XUyPtU3t26\nqxX1DxEQCyUP0J1qKndV/46R+3bZVh45l8y53wzhDfGNhmolrKGPDtLk757s\ncxVH/OXVtotpknoVFsjqYJx51JoKmF8DlHKCCw2KB7/vzh9be3g+kWjYb+9B\neXKCtOfuwXU8QIwQu+Fb1oAHI6lkR0nyx3pKGLEIu0qdwwYw3WV9xNoz2jLi\nbu1gjslKK9Kxi7eXEd4Au2sDu4r5m6ZMLmZX3b6uJ03X9a9WMrvyce7X0XdT\nOHS7Qy2EQGFxP1sErabWwcHg4HUElBvXnvZ58aIf4qjEpqb+/09pia0qRbbk\n2EaV8ZAkOqxi1l+7UVb9IvqtDa82n6GoUpCtSKzaBbdl8aqBDZUD63ziPl2E\nu0e8agMcDZju8MXjrr7VUtOFz2dKwsI7BqMFguhlwCX5w8xshnbRAHBLGkYe\nTwWMSviRwHj+E1LOxHf+CkJ4jOFHsawigE0kf3DhDtcENzgNbCeXeMF/ZbO5\nZJFVXhZoPBMQJAdb6gfcFJ9VyVGKmInOw/p79d/mo/qtEqIBPqpkphG7zHmw\nyKV9\r\n=S08I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcDDZ10cNYXKQa/SXSBly23VI6fZebG7SXBwcpcdcbAwIhAKhX6hbyvzNNgOqrDWGmAWmTkueOe1B6Yo86LWwDRx37"}]},"maintainers":[{"name":"efi.shtain","email":"efi.shtain@gmail.com"}],"_npmUser":{"name":"efi.shtain","email":"efi.shtain@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/try-catch-type_1.0.2_1574606261258_0.6251807198402577"},"_hasShrinkwrap":false},"1.0.3":{"name":"@efi.shtain/try-catch-type","version":"1.0.3","description":"async await brought try catch to asyncrounous javascript, problem is that it is ugly and verbose. Having to write lots of try catch blocks for fine grained error handling is not so much fun, and it makes the code harder to read.","main":"src/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/efiShtain/try-catch-type.git"},"keywords":["try","catch","type","exception"],"author":"","license":"ISC","bugs":{"url":"https://github.com/efiShtain/try-catch-type/issues"},"homepage":"https://github.com/efiShtain/try-catch-type#readme","gitHead":"0782be5320e4774bc3c26982ca27c1e6947e6e7b","_id":"@efi.shtain/try-catch-type@1.0.3","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-b4qFIxV6vBIJglBSQtVVqoxpRQOF4fA1x10SmLDjunUKtoTPYSD+j2vzueRb8sJCaT4DApLqP+CDxIB4w2f78w==","shasum":"0ebb7f71346f89389ca8349d20ff368eb4b2dd66","tarball":"https://registry.npmjs.org/@efi.shtain/try-catch-type/-/try-catch-type-1.0.3.tgz","fileCount":4,"unpackedSize":3287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2wy6CRA9TVsSAnZWagAAQ2MQAIs/maBVfQsxO6uXD0qk\nb81pfbKryAzsKUgJHKx0ez0jGZjRHPXEDr0BvrqdTMqU5sAAoJD1CMF4xnBB\ndhu1a7b+k8utAUrQjtujO6/IHq1LWfRWAHTLHdHUxkTXxe5ITsf371DTRwMc\nVxpLe646/r7TU84WNppvtcaY3/O/5ZdBK5hq9svK8ydV+CeTbJ06S3t3UUrB\nCdoMBhWuYj2hcGAGtswTst7B8SagiQLBi6udeVtoXaoMxtF6A+McxH1zkuKw\n4iCXUnpgvKa1zL50SZUrMRE82wzttj1oLEbnIxFUNbhpRJfvmMFJCUd/+DEx\nhrg+2uq/YeNRFkL4D0+2Bo12kqwbaQWyBgqnm5Z68EZHc6smzZ64hOifRrvh\nbsMx8ZClz+U9soAiEPS4fALSy4DXdcM6TicY+aqwclUHjoAQR11Xi6b8SuBM\nX0CS4roiWW6QL7PsdSM5FYjtuynj2kFDKZ7oJAkieZ70HFn4pU0J/RvcCS9l\nXxKyvUsQKJks1Cghss5q9uO+azwFOqD0bJ2O13BuT3ALcsXNlpT7KAi2fWbV\nrWNT1gHcNtZ8mm8pD/rrPUSCbGKcnmz4sWWAkn2fpYPFx0beSxd70asXCFMo\nxF3QzpOWY/D63vx2BNX/turjcEDd4QOyuaNDZFaLeAM3em8qRNNYh2Ea+QKZ\nrvhC\r\n=h7A1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF6G61n5UInit41uz5EyP9F9oONq/etGeYNaXtWHqQSvAiEA1Si1xv2e0gF0xCeLEJYruHjG4LALJcJoJqWk+ZLTJ0A="}]},"maintainers":[{"name":"efi.shtain","email":"efi.shtain@gmail.com"}],"_npmUser":{"name":"efi.shtain","email":"efi.shtain@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/try-catch-type_1.0.3_1574636729532_0.18564403311060707"},"_hasShrinkwrap":false},"1.0.4":{"name":"@efi.shtain/try-catch-type","version":"1.0.4","description":"async await brought try catch to asyncrounous javascript, problem is that it is ugly and verbose. Having to write lots of try catch blocks for fine grained error handling is not so much fun, and it makes the code harder to read.","main":"src/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/efiShtain/try-catch-type.git"},"keywords":["try","catch","type","exception"],"author":"","license":"ISC","bugs":{"url":"https://github.com/efiShtain/try-catch-type/issues"},"homepage":"https://github.com/efiShtain/try-catch-type#readme","gitHead":"e0276bd2c2e0832160b663a33e05fcb969efc0c3","_id":"@efi.shtain/try-catch-type@1.0.4","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-NQUV+csLCwyjlm9B5ZVHeBQF0py1Ug8SB5ntOIjjGGriFpLBXWtfXk+Opgz1DzdPDU/0hwsBLFyR3EOLCFek2A==","shasum":"ed6d2b35c57c92714ca02f52cbc7d07d18849234","tarball":"https://registry.npmjs.org/@efi.shtain/try-catch-type/-/try-catch-type-1.0.4.tgz","fileCount":4,"unpackedSize":3287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2xEnCRA9TVsSAnZWagAAUSUP/0igBE/ax3uTS6iLBMSv\nv23VF018pFede6hT1xl84SdslMs8pSwIriAC/Qsh02Vc917ySNy2utqZMwSY\nt8p6fpcJgzVUSklVJm+YySUAJ6h9ZJDJ9zU5iBMnvFPJIDB+BaRhZmUNmc+b\nixdAn8be+dVUyzJEvpCaF3l/H/Lcelyw/EUZFjtZ0yXItgXlwmg9IfVO6Bvk\nIiHGWmp0OG+LwguWNimySlNUz1jSnR6vbyihwx4LEHZfXhGXHsVm3cD9cBT2\nE2fM/kvU6r1W3YoVmJbG0cm2GBZvTwDHaPrmR2AL7O35e9+wqAJtv2oS69ck\nO010PbhD2/XVYKmL8QtGq92JwpxM/TXkgBdM4IV+muW5xf5BV15x1yfUaE3L\nTVnNCkoVoFcuR4sWzZEddt/Cmexhn0P2SvMNByqt/kSXVJruvx8NA3bkPo95\nMuHko3+GYip2Lg1swawvxjwtL2utEmCRoZK1ccXqOlU0bVvCqb0h1NwO1D9S\nxLNv1y6JxyGbyLQJ85eknlt2pNB6Fu1CoHlH2ZXNVLmcdc12DBFgqD4+viNc\nnlmCCyzZ50FKqd267C7zVCPgjF+IoTBMOB1lD4707qpmV/fVx8TfdJE8OyEs\nA72DOcHZR6TBSglbm/4L7xmDJTaSwgdY1EobUIr0gVqAcNFeBVHuu2nWgUtN\nSYog\r\n=k2uq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcNjB9XGitrRYrazSTWyzOz2Q4OTO8J2lVPNklW2W8eQIhAI90A2yjuEBbiODt/EIj34uuVHhPDp40Mb/jq+4dhQVz"}]},"maintainers":[{"name":"efi.shtain","email":"efi.shtain@gmail.com"}],"_npmUser":{"name":"efi.shtain","email":"efi.shtain@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/try-catch-type_1.0.4_1574637862658_0.9889686734013752"},"_hasShrinkwrap":false}},"time":{"created":"2019-11-24T13:40:30.680Z","1.0.0":"2019-11-24T13:40:31.118Z","modified":"2022-04-05T06:50:45.639Z","1.0.1":"2019-11-24T14:05:59.159Z","1.0.2":"2019-11-24T14:37:41.361Z","1.0.3":"2019-11-24T23:05:29.758Z","1.0.4":"2019-11-24T23:24:22.782Z"},"maintainers":[{"name":"efi.shtain","email":"efi.shtain@gmail.com"}],"homepage":"https://github.com/efiShtain/try-catch-type#readme","keywords":["try","catch","type","exception"],"repository":{"type":"git","url":"git+https://github.com/efiShtain/try-catch-type.git"},"bugs":{"url":"https://github.com/efiShtain/try-catch-type/issues"},"license":"ISC","readme":"# Try Catch Type\n\nasync await brought try catch to asyncrounous javascript, problem is that it is ugly and verbose. Having to write lots of try catch blocks for fine grained error handling is not so much fun, and it makes the code harder to read. \n\nTry-catch-type tries to solve it in a more elegant way, it allows you to catch errors by type and handle them fluently\n\n## Install\n```\nnpm install @efi.shtain/try-catch-type\n```\n\n## Usage\n```javascript\nconst Catcher = require(\"@efi.shtain/try-catch-type\");\n\n\nfunction print(err, result) {\n  console.log(\"Error: \", err, \" Result: \", result);\n}\n\nasync function run() {\n  let catcher = new Catcher();\n\n  catcher\n    .catch(Error, err => `Error: ${err.message}`)\n    .catch(RangeError, err => `RangeError: ${err.message}`);\n\n  const [err, result] = await catcher.try(() => {\n    throw new RangeError(\"range error motha fucka\");\n  });\n\n  // prints: Error:  RangeError: range error motha fucka  Result:  undefined\n  print(err, result);\n\n  const [err2, result2] = await catcher.try(() => {\n    throw new Error(\"This is an error\");\n  });\n\n  // prints: Error:  Error: This is an error  Result:  undefined\n  print(err2, result2);\n\n  const [err3, result3] = await catcher.try(() => {\n    return \"succeed\";\n  });\n\n  // prints: Error:  null  Result:  succeed\n  print(err3, result3);\n}\n\nrun();\n```\n\n","readmeFilename":"Readme.md","description":"async await brought try catch to asyncrounous javascript, problem is that it is ugly and verbose. Having to write lots of try catch blocks for fine grained error handling is not so much fun, and it makes the code harder to read."}