{"_id":"interrupt","_rev":"105-41cd80bf5e3b3a14f8986fef46c9616f","name":"interrupt","time":{"modified":"2022-06-19T01:48:20.326Z","created":"2014-04-05T15:41:54.734Z","0.0.0":"2014-04-05T15:41:54.734Z","1.0.0":"2015-06-03T19:09:11.421Z","9.9.9":"2015-06-19T06:45:59.908Z","0.0.1":"2015-06-19T06:49:02.629Z","0.0.2":"2015-06-19T14:05:01.836Z","0.0.3":"2015-06-19T14:19:59.159Z","0.0.4":"2015-06-26T01:05:24.691Z","0.0.5":"2015-06-26T01:14:18.663Z","0.0.6":"2015-06-26T02:49:19.239Z","0.0.7":"2015-07-28T04:18:37.507Z","0.0.8":"2015-11-08T05:15:36.610Z","0.0.9":"2015-12-05T05:06:50.957Z","0.0.10":"2015-12-05T23:43:36.745Z","1.0.1":"2016-01-21T05:38:01.720Z","1.0.2":"2016-02-03T08:47:25.316Z","1.1.0":"2016-06-08T20:39:44.544Z","1.1.1":"2016-06-17T12:24:01.479Z","1.1.2":"2016-06-17T12:41:12.632Z","1.2.0":"2016-06-19T21:24:49.001Z","2.0.0":"2016-06-19T21:24:58.083Z","2.1.0":"2016-06-20T12:24:43.959Z","2.1.1":"2016-06-22T12:11:12.313Z","2.2.0":"2017-01-25T19:41:56.447Z","4.0.0":"2017-02-01T00:15:30.171Z","5.0.0":"2017-02-06T04:37:49.942Z","5.0.1":"2017-02-15T09:46:38.705Z","5.0.2":"2017-02-15T10:57:16.464Z","5.0.3":"2017-02-27T16:14:03.370Z","5.0.4":"2017-12-12T03:07:13.861Z","5.0.5":"2017-12-12T03:19:16.683Z","5.0.6":"2018-01-09T10:55:16.996Z","5.0.7":"2018-01-11T02:54:34.882Z","6.0.0":"2018-03-11T16:18:30.360Z","6.0.1":"2018-03-11T18:17:52.987Z","6.1.0":"2018-03-12T06:13:15.669Z","6.1.1":"2018-03-12T23:54:28.401Z","6.1.2":"2018-03-19T18:56:44.665Z","6.1.3":"2018-03-21T05:53:02.267Z","6.2.0":"2018-04-11T20:53:51.494Z","6.2.1":"2018-06-05T15:20:21.971Z","6.2.2":"2018-06-18T07:13:30.131Z","6.2.3":"2018-07-26T04:45:59.345Z","6.3.0":"2018-08-11T06:19:41.025Z","6.3.1":"2018-08-20T08:29:47.274Z","6.3.2":"2018-09-02T08:39:47.129Z","6.3.3":"2018-10-05T07:17:14.917Z","6.4.0":"2018-11-19T00:57:45.238Z","6.4.1":"2018-11-19T01:03:02.307Z","6.4.2":"2018-11-25T08:41:03.378Z","7.0.0":"2018-12-20T08:39:22.266Z","7.0.1":"2019-02-28T07:32:58.466Z","7.0.2":"2019-02-28T09:06:21.491Z","7.0.3":"2019-02-28T09:46:01.628Z","7.0.4":"2019-04-07T23:33:19.688Z","7.0.5":"2019-04-17T00:36:43.041Z","8.0.0":"2019-05-17T00:29:15.012Z","8.0.1":"2019-05-18T22:44:26.727Z","8.0.2":"2019-05-19T02:30:18.936Z","9.0.0-alpha.0":"2019-09-15T07:30:28.415Z","9.0.0-alpha.1":"2019-10-12T02:07:40.298Z","9.0.0-alpha.2":"2019-10-20T06:03:39.746Z","9.0.0-alpha.3":"2019-10-21T13:27:05.596Z","9.0.0-alpha.4":"2019-10-22T10:05:51.390Z","9.0.0-alpha.5":"2020-05-04T20:28:32.874Z","10.0.0":"2020-05-04T20:36:37.413Z","10.0.1":"2020-05-04T20:41:29.289Z","10.0.2":"2020-05-06T19:36:53.671Z","10.0.3":"2020-05-07T13:14:17.803Z","10.1.0":"2020-09-04T05:46:23.030Z","11.0.0-alpha.0":"2020-10-19T22:31:56.688Z","11.0.0-alpha.1":"2020-10-20T00:10:30.217Z","11.0.0-alpha.2":"2020-12-09T09:00:06.156Z","11.0.0-alpha.3":"2020-12-09T09:26:14.356Z","11.0.0-alpha.4":"2020-12-11T10:40:55.605Z","11.0.0-alpha.5":"2020-12-11T10:44:26.664Z","11.0.0-alpha.6":"2020-12-12T12:33:53.637Z","11.0.0-alpha.7":"2020-12-13T00:21:07.345Z","11.0.0-alpha.8":"2020-12-13T10:37:40.268Z","11.0.0-alpha.9":"2020-12-13T10:41:31.542Z","11.0.0-alpha.10":"2020-12-13T18:32:53.080Z","11.0.0-alpha.11":"2020-12-14T17:51:11.989Z","11.0.0-alpha.12":"2020-12-24T04:45:28.939Z","11.0.0-alpha.13":"2020-12-24T04:48:03.789Z","11.0.0-alpha.14":"2020-12-25T02:22:27.662Z","11.0.0-alpha.15":"2021-01-02T05:14:29.168Z","11.0.0-alpha.16":"2021-01-02T05:16:52.792Z","11.0.0-alpha.17":"2021-01-25T12:11:13.179Z","11.0.0-alpha.18":"2021-01-30T18:48:53.783Z","11.0.0-alpha.19":"2021-03-12T04:07:17.176Z","11.0.0-alpha.20":"2021-03-12T10:16:28.795Z","11.0.0-alpha.21":"2021-07-22T19:13:27.277Z","11.0.0-alpha.23":"2021-07-23T05:18:18.242Z","11.0.0-alpha.24":"2021-08-03T09:29:05.942Z","11.0.0-alpha.25":"2021-09-20T03:07:23.351Z","11.0.0-alpha.26":"2022-02-07T06:30:32.411Z"},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"dist-tags":{"latest":"10.1.0","canary":"11.0.0-alpha.26"},"description":"Errors that you can catch by type.","readme":"","versions":{"0.0.1":{"name":"interrupt","version":"0.0.1","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasyinterrupt","bugs":{"url":"https://github.com/bigeasyinterrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{},"devDependencies":{"proof":"0.0.52"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"f2f710ec10b563af72f16c3028a25207ad2a1fe7","_id":"interrupt@0.0.1","_shasum":"b3d05cd135c01a847167032f9f470bdd2ec278d7","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"dist":{"shasum":"b3d05cd135c01a847167032f9f470bdd2ec278d7","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-0.0.1.tgz","integrity":"sha512-yVv2LzWtYqFFXVq84sUefmCXpbSQARiKrjQflxd8vL6sun8Q9ZkoqzhF5Aqr2TgCWCYFie3oXb08Exg1Spw93A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNNIBCl5X9b5e//DFtcS7DtvdSPadxephygKL5nRddIAIhAJy1jN48M90gMzzTGaVQAMDDifkghAQMU2FgX3cZnoKF"}]},"directories":{}},"0.0.2":{"name":"interrupt","version":"0.0.2","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasyinterrupt","bugs":{"url":"https://github.com/bigeasyinterrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"abend":"0.0.0"},"devDependencies":{"proof":"0.0.52"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"fad9e6d4e803934542012fbe4d632b541c0c0a63","_id":"interrupt@0.0.2","_shasum":"d866838ed6202a7b184091b5279c64e1e91ea4fa","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"dist":{"shasum":"d866838ed6202a7b184091b5279c64e1e91ea4fa","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-0.0.2.tgz","integrity":"sha512-j3nwUQDDQ5py/iG4x+B4FAIJyD1PH2+0swfgfeMz8nEulvzIsteHAk/zcg+ON1UY0UlA2VNICOgfbJmFivDaKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEAqgNxVWRFKmLVZEvgCZOvVmYdUWWnCrE6HzAULJx7AAiEApP2/K6/rcO2EOPovgNPtS8POZ5AIc/zfReCGfmSYGT4="}]},"directories":{}},"0.0.3":{"name":"interrupt","version":"0.0.3","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"abend":"0.0.0"},"devDependencies":{"proof":"0.0.52"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"eadb03dc2adfb128ac9bc27fec9f238a021a7286","_id":"interrupt@0.0.3","_shasum":"c910442e95376dd17f145bb8956b5979f68bd1ba","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"dist":{"shasum":"c910442e95376dd17f145bb8956b5979f68bd1ba","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-0.0.3.tgz","integrity":"sha512-Zn5nWRD00jezsZrjOG/X+QukJQmzID0OUXWkqS/L/rRBOxC7LoeHj2KlPRmNovccvuxI/PxLp7gsHsR1vfzZnA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBFkIsthNY+2OC+dk/Oi0y2Ndy1Vz1Se4xVikQgVx8l8AiEAqRaYlk2dRnvBOIHlz/5rpONI6Auo8wVeu55THz+QVr8="}]},"directories":{}},"0.0.4":{"name":"interrupt","version":"0.0.4","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"http://github.com/bigeasy/interrupt.git"},"dependencies":{"abend":"0.0.0"},"devDependencies":{"proof":"0.0.52"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"0db5ca2ba9ae2c31343d5359712fe1a81c594418","_id":"interrupt@0.0.4","_shasum":"7ada741fe05e97f8d287aa5cf6c0da05de13cc64","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"7ada741fe05e97f8d287aa5cf6c0da05de13cc64","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-0.0.4.tgz","integrity":"sha512-xIieQ51WCy3h1RFEUmNmqXq0Yaz4NI9NsysoGxJT5YO4wkU6Bst1LhZw1/W7Tso1E5oKkxPICJePuQo7qpEdzA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCooq3Svigm6UBK/3FxOTUZceaqYP7mOt6ni4obqRmGwIgCef16JbHRg0NQ3hPoykIEHm6BWJMMEAl5nlJ7hMCemo="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{}},"0.0.5":{"name":"interrupt","version":"0.0.5","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"http://github.com/bigeasy/interrupt.git"},"dependencies":{"abend":"0.0.0"},"devDependencies":{"proof":"0.0.52"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"658c482f646744a11f70c20064fb47905393e83a","_id":"interrupt@0.0.5","_shasum":"d7229f6d7d0b5a9c90f0444b77793cbae635becf","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"d7229f6d7d0b5a9c90f0444b77793cbae635becf","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-0.0.5.tgz","integrity":"sha512-Tqcs8/qlRIbZXeJnk1RZrNrvloz4omrz2W34xaimwkW7+ZLcZhTm7io6Hga0Ly0fPyUtuUPC7/aE1EoD3g7A0g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv8sDAK9NzAZt3PXJRH3exyOQ1zJux4a/2XLHuyzx9pwIgEEm0qji1na9yzgIEmjjAVz2J++XXWE+hG//HcR5aggk="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{}},"0.0.6":{"name":"interrupt","version":"0.0.6","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"http://github.com/bigeasy/interrupt.git"},"dependencies":{"abend":"0.0.0"},"devDependencies":{"proof":"0.0.52"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"8f0d3ec40be7e891a009a1e96289d16b1735accb","_id":"interrupt@0.0.6","_shasum":"98c64a11cf0e3a2d2e3bbbcd70ab0055e6f22e6b","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"98c64a11cf0e3a2d2e3bbbcd70ab0055e6f22e6b","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-0.0.6.tgz","integrity":"sha512-tM5o4jqDVjrfEqVil8KgNH8QfIcWNZq/OJJiDSsi/N5Szvb7ebWYcmxGUcjBahrKovnmHtg5QeZRUKBlKhR6Bw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFJ57YV4RWTzfutf9kfLDM8uqOQ6OEg1VDX9Rw5S5nx8AiBy7tiCWcNMPOPm2QQdHdIb0Di/aRvsHAbjeTTn9FPEVw=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{}},"0.0.7":{"name":"interrupt","version":"0.0.7","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"eject":"0.0.2"},"devDependencies":{"proof":"0.0.52"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"4b75dea80cba63005675b7d03bbbff6bed86329f","_id":"interrupt@0.0.7","_shasum":"6a10db2c518ea0fddf51b8af9e856e5e8d057a02","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"dist":{"shasum":"6a10db2c518ea0fddf51b8af9e856e5e8d057a02","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-0.0.7.tgz","integrity":"sha512-w6dNryAsvduLN7qReBS8O1DWrDI0IeKVBR4HFqQ5h4At69mvxDY790j8FeK2lJIu3Uqb5JCn/7qWgitMjn3Bgg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtk9zTORK4UH7+b4hQ6ebskz4OAzB9U5z7MHsqIruPeQIgQ71WLoMygnkiyB887TTbcyaKAvZ7du16SyuaYduppzA="}]},"directories":{}},"0.0.8":{"name":"interrupt","version":"0.0.8","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"eject":"0.0.2"},"devDependencies":{"proof":"0.0.53"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"d438f74b5a893f2df9ed350332ec84336b4a790c","_id":"interrupt@0.0.8","_shasum":"a1f4f272312859e6b135e297f0ea15678127a2d5","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"a1f4f272312859e6b135e297f0ea15678127a2d5","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-0.0.8.tgz","integrity":"sha512-5leDq+1Faao9dok6VujlTkOhNYN/X0l/qXfJnOzhnFGzi7418XHKLJdWf83+o82r7N+lUaaAWpbDRZfq4iEWdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG3z9fD4yOChpKL+8rHmVpaQvm5d6ivMfziwPO5rFoZoAiA0Sn7OvvCf8qfXtwCzFeSgllN8aGGLxH2hT5BY9eA/Aw=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{}},"0.0.9":{"name":"interrupt","version":"0.0.9","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"eject":"0.0.2","supersede":"0.0.4"},"devDependencies":{"proof":"0.0.53"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"4c4be59e9a084bc15a94dae736ff56bea3a11b58","_id":"interrupt@0.0.9","_shasum":"246efb8da930d7170a7cee31c2088d15dfff4e97","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"246efb8da930d7170a7cee31c2088d15dfff4e97","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-0.0.9.tgz","integrity":"sha512-0qTGnrsDE2qO962rkG1TwTU6Ix8hYUIhRN+Q7/v5YZ9X6UtgRSnznLQhHzN2Poy/jXa6lRweIEZQt0Y+Pu3O8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICl69kTfyfueBTRnZMPpDfUFGTG/HCOE85ZnmPKWu+VIAiAVPMZkBiRZFTKoRw4kcMcWjrytOaTlPUsWPiuUsAnv5w=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{}},"0.0.10":{"name":"interrupt","version":"0.0.10","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"eject":"0.0.2","supersede":"0.0.4"},"devDependencies":{"proof":"0.0.53"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"e4fd0aff98765e2403b296dcb395ed1f5ea184d3","_id":"interrupt@0.0.10","_shasum":"49f72ed5fd388bd1818c62887509b39b10b70f3b","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"49f72ed5fd388bd1818c62887509b39b10b70f3b","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-0.0.10.tgz","integrity":"sha512-dIGHOE/2zW8yLgB+tzjNYmkdRSoo7xdw7NliGmwmf5prEAsHOaqmpVThPsrz+OiN54WqeupPnHoeTZOKT26YhQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEplEz+7tpQQ8Upy1JFhYL/6Ni4Bcalky3oW7M3d3HLiAiEAtMg+7+TbwIh71mQlL9S++VUOa1QkbpVV1deYMyGFHBs="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{}},"1.0.1":{"name":"interrupt","version":"1.0.1","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"supersede":"1.0.x"},"devDependencies":{"proof":"1.0.x"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"999750809662bdbf7f5992906a5e7d8c9ff49732","_id":"interrupt@1.0.1","_shasum":"0e33959d3f6a7fcc75ec6c491c311d03f1b8a453","_from":".","_npmVersion":"2.14.9","_nodeVersion":"0.12.9","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"0e33959d3f6a7fcc75ec6c491c311d03f1b8a453","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-1.0.1.tgz","integrity":"sha512-+7pv3XrrxTLCDG3BrfvKovpJUsj7OzVIBt55+1VolpHAuMp6MbhQ5AZxZasXAwFkVmCjPcxvYe5HlVysitXazg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHPPoi28jJHWOOzlKpZq9+J95A2pS7SDOMZRUFjHjTgLAiA8eMwf3nEb6o/xKLAuwwCd35ezsUF6RuShSlf9N8pWRQ=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{}},"1.0.2":{"name":"interrupt","version":"1.0.2","author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"description":"Errors that you can catch by type.","keywords":["error","try","catch"],"main":"interrupt","contributors":[],"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"http://github.com/bigeasy/interrupt.git"},"dependencies":{"supersede":"1.x"},"devDependencies":{"proof":"1.x"},"scripts":{"test":"proof platform win32 && proof test */*/*.t.js || t/test"},"gitHead":"612c24fab851903a921786b696183f3f2b58da92","_id":"interrupt@1.0.2","_shasum":"d89bc83f682d9a9d9783e482f6671d5335f264c7","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"dist":{"shasum":"d89bc83f682d9a9d9783e482f6671d5335f264c7","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-1.0.2.tgz","integrity":"sha512-99x8Zr2ll9bAz0PQxVdVvpXmFtWOkAuc9LbM2F14xfa0SEV8qhsV2TrbHHDfZ+JtoxIqgdr8I98rsUNwvQkvOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHC6PH9Ya2yYCqCqq424msdkDULb5b1+E/MGjXGUPwROAiEAqO7vE0PxL6P97vTKYncA/LZxMzx4fW6BiszyFCgPCRk="}]},"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/interrupt-1.0.2.tgz_1454489244191_0.4821227916982025"},"directories":{}},"1.1.0":{"name":"interrupt","version":"1.1.0","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"supersede":"1.x"},"devDependencies":{"proof":"1.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"e7faf6f8d9a42e2cd8296a437ec9680172b3f7e7","_id":"interrupt@1.1.0","_shasum":"1b42402fce0f4f4d5ec2336ef64e0ab2944208ce","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.4","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"1b42402fce0f4f4d5ec2336ef64e0ab2944208ce","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-1.1.0.tgz","integrity":"sha512-1hqiTN9q26Z8zq47F8Zk3jc8PcKpdRuPCSxmv79f/q9kCfL2kJ125tx4rG9/eXQy8AEq7i6+9wHNMj67Ms3mFg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChXRQGmqfngYlxLzSm4u4NPHyEJ8GqhHu6WvDKKN58BAIgA7v4UNxHqAGFFvM0+W/wC4RVN9H93s6drlrW9wJAFkw="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/interrupt-1.1.0.tgz_1465418382330_0.8340521156787872"},"directories":{}},"1.1.1":{"name":"interrupt","version":"1.1.1","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"supersede":"1.x"},"devDependencies":{"proof":"1.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"a8c275d3872a200ce34c495db41d2a1f49936a79","_id":"interrupt@1.1.1","_shasum":"e788b07115af75f4ffd603dfb8315221262d3008","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.4","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"e788b07115af75f4ffd603dfb8315221262d3008","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-1.1.1.tgz","integrity":"sha512-S1wmhpux6hRGkvd0cWk37KjA2PQgNancToT/9uW31e6WX/jX0HqjB9eW+qupkztfhcHgjCIRP4QbJ2Eam9PhxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA2hhCZx3HSlOW7eaRJoYRoeviMkoSF2tVEllopgyqAfAiAq7ekgO3V+BkPJIqHlG96H2hnMCdHbSamRYrxk19OKSQ=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interrupt-1.1.1.tgz_1466166240398_0.7010176114272326"},"directories":{}},"1.1.2":{"name":"interrupt","version":"1.1.2","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"supersede":"1.x"},"devDependencies":{"proof":"1.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"b78b6f9e96973b2e635f95a6a0d54bf5fc39ee18","_id":"interrupt@1.1.2","_shasum":"dfaa1580412f83455652cd55f5cb3de78fbe75a5","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.4","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"dfaa1580412f83455652cd55f5cb3de78fbe75a5","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-1.1.2.tgz","integrity":"sha512-Q4i1hPSVtkHXcYR0WVo4zwySYfJ+1Vot6gHZ1+bHJMB4B2bAIzfaZAhiCEJblEbRVxUc8CcRCPt1Oive9JHxOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZr474yIIXxPmASLpubqwVvrrC+C2ryC886BAzw5JK6QIgV++FBQiWHRli8TANN8pk51TjPlw0z9cNZeMwts64GCY="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interrupt-1.1.2.tgz_1466167271477_0.10668123257346451"},"directories":{}},"1.2.0":{"name":"interrupt","version":"1.2.0","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"supersede":"1.x"},"devDependencies":{"proof":"1.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"edeb1b21b9c21c14f878c04513ee72f3a800e573","_id":"interrupt@1.2.0","_shasum":"8f8e0d0cfba190e74682e82d8f0439205a670209","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.4","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"8f8e0d0cfba190e74682e82d8f0439205a670209","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-1.2.0.tgz","integrity":"sha512-tLNebsqj9FHpUONB39XnYLtf6s62WPN2bV4j4EoqWsjsEHCIy8s9/wsogcWJg7T2Us11BjBKXvrRNRIRf+Kq2A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALrSJFDTGXxO3tIGLyISlLQRlql/QOAX5tVc3Bp3SF1AiBz8lAJPaYhtqbvLGTfxL1wMzrytvAdu/HdpbyyhUB9nw=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interrupt-1.2.0.tgz_1466371487770_0.6635912815108895"},"directories":{}},"2.0.0":{"name":"interrupt","version":"2.0.0","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"supersede":"1.x"},"devDependencies":{"proof":"1.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"eb889b185941a2dcb0a4f04c12dde319c8ec60ee","_id":"interrupt@2.0.0","_shasum":"91f96049367be5f95388ba67abe084ff374b0747","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.4","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"91f96049367be5f95388ba67abe084ff374b0747","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-2.0.0.tgz","integrity":"sha512-KuaXZ7pNyAtg4eMtToA6toLuy+KhbWMnKX7PIN/fh8OEmCHmYxKVjtXGYkBl1YhkXpCaggdhLHFKKS/AA5yD6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdRa2xJntzEHy/gwTMgdYPXjzKw3aifQo4H8C+BDOXlQIhAM8jkdnvOps2TxH2O7Cj+kdxgTGikcbFZo069Izo/v/0"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interrupt-2.0.0.tgz_1466371496716_0.4713605814613402"},"directories":{}},"2.1.0":{"name":"interrupt","version":"2.1.0","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"supersede":"1.x"},"devDependencies":{"proof":"1.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"403c66548165b057f2383364748d446ec87de1f1","_id":"interrupt@2.1.0","_shasum":"d35bf0cfbb9dee0e5464f164bc95f95253a0b82b","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.4","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"d35bf0cfbb9dee0e5464f164bc95f95253a0b82b","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-2.1.0.tgz","integrity":"sha512-sYeNyF5ZswWofTAmdkgaOhIRNEz9aHjq6LExLWfpJYKe2J+aFkF2Hg29eW+md3DZYaiD3YeZ9Hqwf1YlHYlMCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuzpLOFX4YoI7YwvTmrCYVoz8sm1CI2DgD4KiN1FyTiAIhAJmx/AO/t/psszXeVm+x2NnDGeyDhNvY6f1ZxXRJCYyk"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/interrupt-2.1.0.tgz_1466425481226_0.44201721413992345"},"directories":{}},"2.1.1":{"name":"interrupt","version":"2.1.1","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{"supersede":"1.x"},"devDependencies":{"proof":"1.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"dcb19890cf8572d0e56582e7d0f7746af1eed72f","_id":"interrupt@2.1.1","_shasum":"45e25d31b7c10ad101563fe1074b8cc679738aaf","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.4","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"45e25d31b7c10ad101563fe1074b8cc679738aaf","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-2.1.1.tgz","integrity":"sha512-9ZF7tEh8A6a/1loHBCxlHJTkiSpsgR5tn0MJmm5bDuEnQlxeKGZi71DcEenYPbNKJM0wyEP/szSa4D3ZuEKAow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICT5efJ/Y4g1Wx1gmDPhkfyzWzEGR/TjNqZnSv0x4eFOAiBJ1/Lvqp/UPq19/G4Ngxgt+rQu1uungexuHEPz1xPF0w=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/interrupt-2.1.1.tgz_1466597470489_0.32331987004727125"},"directories":{}},"2.2.0":{"name":"interrupt","version":"2.2.0","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{},"devDependencies":{"proof":"1.2.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"945be470a681893728223786f19488cb41b6dbb1","_id":"interrupt@2.2.0","_shasum":"7459fad57d88d8c1a7e4d9e1cc87cc897c62cf34","_from":".","_npmVersion":"4.0.5","_nodeVersion":"4.7.2","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"7459fad57d88d8c1a7e4d9e1cc87cc897c62cf34","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-2.2.0.tgz","integrity":"sha512-om0k4QzUn550AL5oh0JWJIvT5b9D72sHhuViNWQ8nDsnfjcHV1fRabS1HLf55jig7p7+R4pTZxR4AklKhTOV+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCtmEXa7uNVdHXpGNWRlcauWP8AypQFpUdsfjPbPH8SAIhAPJ+7mVHrL5mP/oaswb0lZxtqfcvxILeyBopM1+nipGF"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/interrupt-2.2.0.tgz_1485373315671_0.21175441262312233"},"directories":{}},"4.0.0":{"name":"interrupt","version":"4.0.0","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{},"devDependencies":{"proof":"1.2.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"2e308a9d2bb7e5a75919f028023c90444585fa4f","_id":"interrupt@4.0.0","_shasum":"98be579d495d193bd0b0c2a1f13c6fad6dd6dced","_from":".","_npmVersion":"4.0.5","_nodeVersion":"4.7.2","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"98be579d495d193bd0b0c2a1f13c6fad6dd6dced","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-4.0.0.tgz","integrity":"sha512-mOBSDUdR8AbDgzYcXf8to8mk9oAB48nPpIhHolJo4Qze13jgOt8CV1veFpVSQZ1rO1aKlKypAYm0LD+RSMocqw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE2AqZxShfFSH3Cy+S0tXP17ZbCmMtBZem3K/mIzeIBjAiEA2l9C6IeF4GURNy0Bn79lstiY0qvAOTiUqeif+g9jc20="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/interrupt-4.0.0.tgz_1485908129472_0.1354615055024624"},"directories":{}},"5.0.0":{"name":"interrupt","version":"5.0.0","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{},"devDependencies":{"proof":"1.2.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"af802c7095e03b265a00f712c05de9ed51fc078e","_id":"interrupt@5.0.0","_shasum":"cdd22cb8917b33e9df7290b5158e7340afc085e3","_from":".","_npmVersion":"4.0.5","_nodeVersion":"4.7.2","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"cdd22cb8917b33e9df7290b5158e7340afc085e3","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-5.0.0.tgz","integrity":"sha512-nYA1G0DyKlSgX+4Wc/WX5qoVgbHRg9Uj4C2poUFWlaDAa260i98vFOBIJNAIc2eVenEHnlsAZjEEvWJQGGubXg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEoITBg8AB81Ip9day4PW8gLmndNuiziuzoItkrxR+c9AiAELQB84CGTeo4bbXnioXpETv7G48Aq4s32KM+adKlIFg=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/interrupt-5.0.0.tgz_1486355867460_0.03834831574931741"},"directories":{}},"5.0.1":{"name":"interrupt","version":"5.0.1","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{},"devDependencies":{"proof":"1.2.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"40f1816a119db170263ff5af3d9453a96f56aaee","_id":"interrupt@5.0.1","_shasum":"0ce37583c7ebf10b10b45e553c98eb2178f7e36b","_from":".","_npmVersion":"4.0.5","_nodeVersion":"4.7.2","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"0ce37583c7ebf10b10b45e553c98eb2178f7e36b","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-5.0.1.tgz","integrity":"sha512-lFEzzjvhxJIXok7eX/K3oGoOL4dfMhZFmUK1wb1q/4uxqNJXltDRk16XJgdX9VbwfbYDM6yVkPiJRVHbpfr9og==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAo2hZEKwUFRFUdiDlTG6T0gW38h9TgzQS3B5ISms3SdAiBVnWbP/aj9ekohl/TSJP96h7727dFq1VxE5NyMyHp08g=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/interrupt-5.0.1.tgz_1487151996391_0.5588813342619687"},"directories":{}},"5.0.2":{"name":"interrupt","version":"5.0.2","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{},"devDependencies":{"proof":"1.2.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"79262a44ba82f28327122608ed09af7c3c1c0281","_id":"interrupt@5.0.2","_shasum":"7fec1f5f38a7cd3430882d3f9c68daaba77274d8","_from":".","_npmVersion":"4.0.5","_nodeVersion":"4.7.2","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"7fec1f5f38a7cd3430882d3f9c68daaba77274d8","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-5.0.2.tgz","integrity":"sha512-CuHmFUFAUIbtbL2o3pTzQloxszyeV2bXP+dbPXbf6o1BJLgB19pwd8bRjIRHZdKdeaGTiZnh9UuwRzVJepIzrw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwHCgxE2XWgFhk3wAkbbvlTImLhks7oUeLwQqo94dOAQIhAOa0TwIAZhUs0AUmw+LFIFPWDP7TlQBUnwPo4vs2BRJp"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/interrupt-5.0.2.tgz_1487156235757_0.3882563700899482"},"directories":{}},"5.0.3":{"name":"interrupt","version":"5.0.3","description":"Errors that you can catch by type.","keywords":["error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{},"devDependencies":{"proof":"1.2.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"d8ba2c57c223f20942ff2fc161546314a61f7fdc","_id":"interrupt@5.0.3","_shasum":"e4074393e7566aa9ce1a004d987764483243be6d","_from":".","_npmVersion":"4.0.5","_nodeVersion":"4.7.2","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"e4074393e7566aa9ce1a004d987764483243be6d","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-5.0.3.tgz","integrity":"sha512-upcQ+uOJASqaz9/L0Om6OXcGonBTbznfGG1w9srkoINa4kVjU3ba5XN7pfDDjSjDtPHLe9UCbJacjRi44VU9HA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDn7JeHcuCWFjVNZS/71aHBmNyTsZ2jrNyb+amnUbEuEQIhAPhR8UzuOW1De3DoitPzQNtR9OcGcO8NngSbeXdpRF6s"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/interrupt-5.0.3.tgz_1488212041163_0.6516820394899696"},"directories":{}},"5.0.4":{"name":"interrupt","version":"5.0.4","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"251410b9b977eda0bbafa19466b26e3ecd6f80f5","_id":"interrupt@5.0.4","_shasum":"789d5ceaa48080469d2e1856976e7031d15fda0b","_from":".","_npmVersion":"4.6.1","_nodeVersion":"4.8.7","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"789d5ceaa48080469d2e1856976e7031d15fda0b","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-5.0.4.tgz","integrity":"sha512-tv0ajUIQ3P2UB5kLuOODhDLkCI0r2a3swr4W5MnSl/IppgTZJCHe3/3tyMyEO/gpTeVYFR0CJDj/XNOA5EPUFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICpHerPRfWDtWCvz013R35NVmlHJJT8a8sxPlf3nJVHGAiAMXz1AKecTS5TL/Yjwv75TnpLS0+4L/96nrTJx7meqUw=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt-5.0.4.tgz_1513048032903_0.05481064459308982"},"directories":{}},"5.0.5":{"name":"interrupt","version":"5.0.5","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/bigeasy/interrupt.git"},"dependencies":{},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"2245b83fc1e6856508a9618b268af06fc85ef9ee","_id":"interrupt@5.0.5","_shasum":"c8039acf01249ee7382a436b5c7c1fb81e883434","_from":".","_npmVersion":"4.6.1","_nodeVersion":"4.8.7","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"c8039acf01249ee7382a436b5c7c1fb81e883434","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-5.0.5.tgz","integrity":"sha512-1VZkJFVvZUKnklq/DK/z/p+FsOGnhonwdo5efn/opUFIe913xKSZpvRJAxBv58yY3mXJ0ZFx3DOm/Y5ZvpH2TQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0mHQqwk9PgI5XFUEHmwjA0i4ibfvuMM9CiE9nkWVa9QIgXSDfKAwpAab0ppazN1qx+1f4znXuCy4dS2+uIiStkz8="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt-5.0.5.tgz_1513048755626_0.02657302375882864"},"directories":{}},"5.0.6":{"name":"interrupt","version":"5.0.6","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"0a3183c83590b18f8f7d3d9df109709d4d261b07","_id":"interrupt@5.0.6","_shasum":"30fbec45b91524683a8fff2fe5786e56613299ab","_from":".","_npmVersion":"4.6.1","_nodeVersion":"4.8.7","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"shasum":"30fbec45b91524683a8fff2fe5786e56613299ab","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-5.0.6.tgz","integrity":"sha512-ljVciBSahOVLpSR1zJaw7pQdMnEoKf/GiQPVDKUxM9wndeniEFWJlCT4J+KoscCcgB/RxX4XEK4mYv4h6hZ4fA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF3+Fsx7daFmkeTeKXFXZiudPxJ1waNiyfoBI4JUtoPTAiAQ7fpVio6Lni4R9pnbH+1LclDB9ClAh0qy9M87xBOFnQ=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt-5.0.6.tgz_1515495316069_0.567960629472509"},"directories":{}},"5.0.7":{"name":"interrupt","version":"5.0.7","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"10dfe550752445731386958ffea213d2e1dfc1f7","_id":"interrupt@5.0.7","_npmVersion":"5.6.0","_nodeVersion":"4.8.7","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-j562pj5z2FjVPTdC+99pq0d3/jpZw115MxNYMctKK9wckgGj2T9dxB31mSA2B6H3xHwZZtmYl3i98by/hi9WfA==","shasum":"ea48250670d28f3de4fb7531631afefcbe9fdb07","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-5.0.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF2Fks2g3cnmgwCmr3YAp/QyUgpq3NTtQbfXFyQyPvAoAiBunHwvmIdwazTKo2Q8LMlISw4RF2mjf1AsDmcn8ZyRgw=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt-5.0.7.tgz_1515639273902_0.7250753818079829"},"directories":{}},"6.0.0":{"name":"interrupt","version":"6.0.0","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"json5":"0.5.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\nThe problem with Error is that it reports one and only one message with very\nlittle context other than the error message and stack trace. There are\nadditioanl concepts in exception handling missing in JavaScript that Interrupt\nre-introduces.\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Nested exceptions and context preserved in the `Error.stack` and extracted by\n parsing `Error.stack`.\n\nAppears to be a piffle but it is pretty effective and easier to use than\nfiddling with `Error` directly even with ES6 support for classical inheritence.\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\nIn addition to being human readable the error can be parsed.\n\n```\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching Interrupts\n\nRather than have an if/else ladder that is probing with `instanceof` , I use a\nlibrary I created [Rescue](https://gihub.com/bigeasy/resuce) to catch Interrupt\ngenerated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that test an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The exception is multi-line because the qualified name of the\nexception is on the first line of the message.\n\nPlease note that when you inspect the `message` property of an `Error` it does\nnot include the file and line where the exception was thrown nor the exception\ntype. That is added by the uncaught exception handler when printing to standard\nout.\n\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nThe `message` property does not include the stack nor the type information. The\nfirst line is the qualified exception name. You can match against that name\nusing the following regular expression.\n\n```javascript\n/^module#foo$/m\n```\n\nThe `m` switch will cause `$` to match the end of a line, not the end of string.\n","readmeFilename":"README.md","gitHead":"1d0e7026aec36ec6dbca79253cee3d347ecf7d61","_id":"interrupt@6.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-C3pPNi6tu8rjZwBDIvfJBp1gwjMVd22Nrmi0duiY1xteKHpYxQzILcxslDRap3gM3WGqW9F1dprP+ZYd+gjGwg==","shasum":"80f7822e711cf10c2e4cb556873c2c76297cc563","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.0.0.tgz","fileCount":22,"unpackedSize":27334,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZh78EisRD0zNCGglyicbcdoOnD418QTyQraiFm6UTugIhAPrBpXtovqlb3oNlopyePcB7zPemq7OUqvF7TI9SG155"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.0.0_1520785110299_0.305360357584179"},"_hasShrinkwrap":false},"6.0.1":{"name":"interrupt","version":"6.0.1","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"json5":"0.5.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\nThe problem with Error is that it reports one and only one message with very\nlittle context other than the error message and stack trace. There are\nadditioanl concepts in exception handling missing in JavaScript that Interrupt\nre-introduces.\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Nested exceptions and context preserved in the `Error.stack` and extracted by\n parsing `Error.stack`.\n\nAppears to be a piffle but it is pretty effective and easier to use than\nfiddling with `Error` directly even with ES6 support for classical inheritence.\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\nIn addition to being human readable the error can be parsed.\n\n```\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching Interrupts\n\nRather than have an if/else ladder that is probing with `instanceof` , I use a\nlibrary I created [Rescue](https://gihub.com/bigeasy/resuce) to catch Interrupt\ngenerated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that test an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The exception is multi-line because the qualified name of the\nexception is on the first line of the message.\n\nPlease note that when you inspect the `message` property of an `Error` it does\nnot include the file and line where the exception was thrown nor the exception\ntype. That is added by the uncaught exception handler when printing to standard\nout.\n\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nThe `message` property does not include the stack nor the type information. The\nfirst line is the qualified exception name. You can match against that name\nusing the following regular expression.\n\n```javascript\n/^module#foo$/m\n```\n\nThe `m` switch will cause `$` to match the end of a line, not the end of string.\n","readmeFilename":"README.md","gitHead":"817a589f1e79ba59b1c0c21bfa9a77d487939a53","_id":"interrupt@6.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-mB1FCr5GWdZ1QIMV8cpy/xJfewhDR8b0s57cedTTXeOpsgoIXo0mbTbcZk4olscDtktcUkWP1JYkSdMOjDN/sQ==","shasum":"6340c4639c41aa7af0248ff8c899283199d42dad","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.0.1.tgz","fileCount":22,"unpackedSize":27398,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID3wOULMtSP+VMOYlamR9RifYhtzRhnscYuq1CG9LEJyAiEA78l5ISwELbg2q9mO85hRQazVXWoD0EXgErbepa57MjY="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.0.1_1520792272926_0.9924859399897168"},"_hasShrinkwrap":false},"6.1.0":{"name":"interrupt","version":"6.1.0","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"json5":"0.5.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\nThe problem with Error is that it reports one and only one message with very\nlittle context other than the error message and stack trace. There are\nadditioanl concepts in exception handling missing in JavaScript that Interrupt\nre-introduces.\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Nested exceptions and context preserved in the `Error.stack` and extracted by\n parsing `Error.stack`.\n\nAppears to be a piffle but it is pretty effective and easier to use than\nfiddling with `Error` directly even with ES6 support for classical inheritence.\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\nIn addition to being human readable the error can be parsed.\n\n```\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching Interrupts\n\nRather than have an if/else ladder that is probing with `instanceof` , I use a\nlibrary I created [Rescue](https://gihub.com/bigeasy/resuce) to catch Interrupt\ngenerated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that test an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The exception is multi-line because the qualified name of the\nexception is on the first line of the message.\n\nPlease note that when you inspect the `message` property of an `Error` it does\nnot include the file and line where the exception was thrown nor the exception\ntype. That is added by the uncaught exception handler when printing to standard\nout.\n\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nThe `message` property does not include the stack nor the type information. The\nfirst line is the qualified exception name. You can match against that name\nusing the following regular expression.\n\n```javascript\n/^module#foo$/m\n```\n\nThe `m` switch will cause `$` to match the end of a line, not the end of string.\n","readmeFilename":"README.md","gitHead":"9ceb9f9edb93ca931049f0fe0020e628cacdb75d","_id":"interrupt@6.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-J4etutyufLvM8y2N2owGI8ndZ8JzU7mLzxtvUQnNteZUU5R/eT1BTlORFGzg4kkrtRajt0hSzbUgzMrIKsNTqg==","shasum":"29da43538359f2e4ad97ebc273c03c52d54b19a1","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.1.0.tgz","fileCount":22,"unpackedSize":27469,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSaq1W05T7GQ6NcoSxRp2s8r7Debpsa0fANPblKwq0AwIhAMqYSIhrmdcp8liEs2KltDRAwUZ/m4rTidrTKggCS1kV"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.1.0_1520835195618_0.2582347233993989"},"_hasShrinkwrap":false},"6.1.1":{"name":"interrupt","version":"6.1.1","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"json5":"0.5.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n","readmeFilename":"README.md","gitHead":"2b0a3a9237dc8fdf140fa4b4a979211e81df383a","_id":"interrupt@6.1.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-41LFcyPvxw3sL/GTK+ByPiMi+0/UfSkhSZOakljlVM23byKlqGjyQb1HJ7Y07w87CllfN7rzIf6GmLAzoYUItQ==","shasum":"628d090dc3b8b8ec194d93a363471122766bd6ab","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.1.1.tgz","fileCount":22,"unpackedSize":30801,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChMxP/uOo48U1zzEgeZLJWhy6UOE+VNDefINREfE9CLQIhAL5WEoyhuLdq7jW4Q2Gy1CIWOEFcJ4mXTPobURwhYTPR"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.1.1_1520898868344_0.5260504180555268"},"_hasShrinkwrap":false},"6.1.2":{"name":"interrupt","version":"6.1.2","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"json5":"1.0.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"77dd96fe1fbedd9f63facbf301f8a648e14a80b2","_id":"interrupt@6.1.2","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-Ski3xTz775/zQgvTqjwcQJynxC3vi1lHUS7yq91FxNeBTb4qm3ztIe/2gl1aMBbtZs/xeHQTzEEKi7ZH0fPIbw==","shasum":"25ba95c9cebe0aeb71729afa695399408c6860ba","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.1.2.tgz","fileCount":22,"unpackedSize":31060,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7zdWWmQ8Wy2mmSuTtwFk/qRGZPw5t2xXcoQAn6I9r3QIgGffQdl40BJGo3yXuAT4szUrYGbGECVqWXPyi6W+Qerw="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.1.2_1521485804568_0.42900860472869584"},"_hasShrinkwrap":false},"6.1.3":{"name":"interrupt","version":"6.1.3","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"json5":"1.0.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"4ea5a8493d346d4ba02fbf1b1f51001e2bb72d65","_id":"interrupt@6.1.3","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-R50ZblNzKqUpUfumr0JY6WwWCZAYgfdTtna83MyQfS1m2sk2SJhr64M/xzE0oEfGyT8L825W/w4Zf9ZNPSWN7w==","shasum":"595a5d219ede3ce16ecfef236a122204c7e48f86","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.1.3.tgz","fileCount":22,"unpackedSize":31045,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoz3H3S7wkAwci2bKXVn5mfQRDR52pUK+W8fqbzV8GUQIhALLxiuDHkyFVYogqV5lZNnsxJJorXJEIWr9FQFKySaPr"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.1.3_1521611582196_0.014415740575310032"},"_hasShrinkwrap":false},"6.2.0":{"name":"interrupt","version":"6.2.0","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"json5":"1.0.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"e5542788573a5a5827d4c258a8628228fbc2cd88","_id":"interrupt@6.2.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-teavYu1dx4WGTpBtRcOxhpYFvHiHCzNZiwkypKs9D6hNRqUZ8lPmOp7gaBAQOgqzF0sWml9pU3nmk4UqpEx7ig==","shasum":"364fd7f03a8b8e2140744daa40b9e3cc044704d1","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.2.0.tgz","fileCount":22,"unpackedSize":31562,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZy8fwkbO0Al9CLOMog9++L6XLaDG0WROvaw/8o/SvEAiA30ufz7YtGxEBlTdnPXmmOLpadARkigt6ISid81rTWYQ=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.2.0_1523480031308_0.7156614493838109"},"_hasShrinkwrap":false},"6.2.1":{"name":"interrupt","version":"6.2.1","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"json5":"1.0.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"58ac152d6bf780c98bb8b4a25d4ed911efde187b","_id":"interrupt@6.2.1","_npmVersion":"5.6.0","_nodeVersion":"10.1.0","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-G1FHob+9riXY1qD4g7/XQHThIzt13H642cfLDjsB2dAIgAN4SacZcb77aBzdcWZEByqtLGC3j5Slh1KKO78LtQ==","shasum":"d354ffdf1cf9644ee1d7e261df4c3e481ecd25be","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.2.1.tgz","fileCount":22,"unpackedSize":31536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFqo2CRA9TVsSAnZWagAA3YcP/3/hh07srKBgoyB/Ii8C\n6WlsrjZhAhjGY/6YPhrvOtRKQ20cF4m4fZpXl/mjl3DeE0g3coOkdHtoq+CA\nqnMn7UR9W9DuYLQd51YqVBDeuyT432KHdxKFxahTP8cpiR8oIODsxB25f8kH\ngGk+M+jNp0ko5xsafZsWcvGyNTSNQ8OztrPtE4CfK6+Ei4DFaFbkHJGZzXMN\nmWGDhBvmqdGGe8KkHB8U0xsb9fAHfgh9FxeLkW1+oPKhgHzdNNZlP2B0eTO4\nS4DG2UWbmexP1Mksgv+L0GtqX7gW5Vq6XMTjuwxgGlzmGk5qlfIr75vLzVNN\ncPLvkZd3Qc2CJD5SiZsWsAcRVA8efuVZwMDAKRkANR5RcIipMRqIqVFjKZ3r\nuekHWiC1vn0JQaYM+t/d2Y6MfnOTy4CmOUcEUlI0h5Qu+Q5+8ESKA9jD2BNd\nk0PBlIDNf3BaauLbftae/QsTEYJGgR/8p7IA3iAfKC+nSbyAQbg5e/IaCe8W\nV7TAT3xb3EpodItXGW8Npegs5B4ABi3k/kaDLh0RjvDMX03enqWr2vaJAZGn\n8c/I9+crYhWwKCY4gZ4jhM+oUfbkc73NLg82ShXemt+SXaQAthTQmen34B97\ndr7WfNfuKPN6kO/ZJTGNSbIVktmX8KdwxFQH9DsBJp8QieDFjfluoBcWwzPZ\nCQLz\r\n=ssGo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqNCAZajFHwWJpHhgAcHD5G/56klxKELh07m+m7KW/hQIhAJrzXX5UmNLW0PPfMyqgBh0vO6jo7lSz+edRGBdNtf+J"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.2.1_1528212021613_0.44166997980009315"},"_hasShrinkwrap":false},"6.2.2":{"name":"interrupt","version":"6.2.2","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"json5":"1.0.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"40e0d26d2b77a3357011175b96f3e5e5b4b38b86","_id":"interrupt@6.2.2","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-dWbAXRmam/5CkW7op94HjgIwKJir8eTPBL2wNVkGm0hk4zVFmOW/lhH4yd9ooM7JVdPX3WZQYKs8FmemjUoIJg==","shasum":"9379a2e118fb742f9f5c2ab67fe1712e6deeb1b7","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.2.2.tgz","fileCount":22,"unpackedSize":31672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ1uaCRA9TVsSAnZWagAAiYcP/jv8O5YcEvn3DwvjtxpB\ntz9qkRXzwCNOMxZT7hVUfAULTfOslwLv9gRfFgufR0SmfsXGTY25OYSb6yzD\nt+wRFMtMQ/hnuzRwhtPPfXx3c1Tzujvog+lfoNtLEsgJSXpyINM28ooz+5ah\nAmxFAH6gVX6ZqeiHD/EtWq7QrVoLPwnO3BuY+SM6Y8mZbsavC20ONKnBk7MX\npIJU7w6ZA6XJqMYhzZrW7sqME+Bkurd9zUZfXhA385xnbjvLopX7vNUYnTdM\nBw6JwhfQb/FZdn/Pk11cK5YcbH0vq/em5SqrSTjZE3mImAlTNpkD6ZhyPrBJ\n1vYVulWCla6l4ASv9z/Y8FjvqWBfjL46aLPkrwSkjygAM0+l+QdeBS2J2roh\nl0HgjDQ/mcsLneMFKkJMYlSRStKige7HMRk5hR/2LbocQ8At575y5lrPdCEY\ntgVCbBk57ghoE8yj6bhds8X4Wuoj0D1nfoJQ1p7SmkaKHPX28bpAQtBGc7CD\nvaQxt7B9AdHrB3zwuztnH5V+CanNOCBZ1yBqpKcw2hkLqAHLLEewYM9/0JBP\nE5uJqOXJo5BVwqHT/PBcLLqefTwogvzePQNbv/RmAAwrNgn6GF45DBXozI6y\nNt/u3j1SLbZpojRIKEBoOJq1fPkDFm95Z2Ox6nvGYc9JfqTehQ7XwhUKFQ5U\nSQ1f\r\n=UKnF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAjWZ+ZF3f5qKMNCWqFY/0cphM4g77BzGu+nej7iKUvEAiB7769jpMZMTol01a1BBGL0qgQ3JCD4wMwiaeTufzD2pg=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.2.2_1529306010072_0.4589742172111564"},"_hasShrinkwrap":false},"6.2.3":{"name":"interrupt","version":"6.2.3","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"json5":"1.0.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"338b009a885acfe947f9c0e57dba94ea111b704e","_id":"interrupt@6.2.3","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-LKAbccgLY03hJeGwD9rHEroGirW5aOoW/XQHlAyccAKC8CMeo1ctWkltLeN8VikIHkwA1RG3bt6WV+Voeifs0A==","shasum":"7958c7cadfb28f8184088a74302d36fd846838b6","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.2.3.tgz","fileCount":6,"unpackedSize":18246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWVIHCRA9TVsSAnZWagAAAC0QAJ0tRXWSwW/FWatyRBXX\nOP9P/foOditVe4OQtoigsnTkZOfiLmIs93suC37yb8eJah2A/K+U4CsESc+l\nLdxWPRCjrMF9VTJgFUT8B3TghPqgGreq0vd54AcYltkgtvgC2aFVsV1y4xZp\ng1xpwZTp5Uo7vLDBg97D7hST3VOVUzx/dSyX/XKMLwK6ukscqPNZYrCfdPC1\nhU405qHMtz0tqDQJU6hrT81Tr3IqwlRo+wwmTuzY9qiYcXhfQps0gvy1BU64\nAmnhQFMcG9IW6zAZfYwUX8M2glnefqjJWNYA8NlI8VBoesRaUeuFk+T2dxR1\ndvnxgjKMnmzKXXUbpJCYDHppMamhoCF+Ymn5uNWdhof8MLMwmHWpE+ymr0ca\n8Jix4BDHD6u4L/f9YE2ac0lBzwRcmK89qsam7E64eLF86Sq2dIEw6aH491af\nMxgnerlOcYiplcVw7p8LZVrpNEhu7VI6Jjz1cCc54ZtHyrflwchWYcMtLx1f\nIpnrzSOOvqjiJuWPIRwgGyXne8jQz1h5ocajAZial3TlPTuWIVptDW9yLJ9W\nd130LvP9L8Tu5YkQVraweL8VE/VbutzJbvOnvpROpLuuQTYx59ZamzyKGAAI\npw8NKi3e7roHaqKhXIt5dxbgWLCSRmC/ayN/blbYTZfvGkFqh8sz/OO70L4Y\ngQLT\r\n=9doo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID6f8vYw6jABPVQgLIyyPT3pnlsSZnqQXJvCoTJYJuU0AiB73JpWvjrT676RcM0+tqO4zvx1rayrTCBVYjwOdAiMJg=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.2.3_1532580359253_0.8893937865568218"},"_hasShrinkwrap":false},"6.3.0":{"name":"interrupt","version":"6.3.0","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","json5":"1.0.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"1f9e876e9e5c94a4836e7e8b56c8a172a07a52a1","_id":"interrupt@6.3.0","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-M74VSqsabUcCtyJi+OR1O3gTEBR/cpEewTi2JVK/wYTkom/MYAL9024FaGtWhUWrmC6L13sE2l3YbfayfSrauQ==","shasum":"46df6c69881e923c7e0cac3d400cf46df3d78582","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.3.0.tgz","fileCount":6,"unpackedSize":18811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbn/9CRA9TVsSAnZWagAAYd0P/jCJQ+SPWAXpsOMx535D\ncCAVX7+97/O4cV21M7gXLydHRr1oC5LwHI4R0u/T2ZoHh47OcfeoW2SuqrKP\nlLW4KyI5DXWL/3jGirKGuMA1VTUVj/PK9ocNciy95y1WNQHHZOSfrEW4Tzzn\nSsPuCCcrbC/Q49LKReMuAOqjReWVFkKNF7OVBS8eZMcRZNyYA6b0ISR11aPU\nK88CrRJNshNJ+ElFT5GLFJIkBdgs/7cIxtGNZfehBEffoPdJsjAincRagsjU\nZiycfOO+uDx3lwHJQMOEMBbkbbxBDE/V50tokMm2ot+XlTjZmBiCA7GxwCio\naHc1M6456vu/RWxXDqqXjXe18WsayOLGRS5C2OMfNXgJ6xa+IbPVaH/kymX2\n27ro4NviaxtStxxUqkuwTHIaRfSdKcAZ//7Bpe9srnOxVHYjfWLS0NbXRBwk\n9ehkc2mqKxnS/8nqDMxQd3yaoD1oEuPT60WlWXNJIyiMX+uMPRoOSrn8IY7p\ntX2cuYZ64ejyWhsPljKbTM5HAxTB73AIyS+VQT2UHJJNTmrq7KfgN8RrE7zK\n6Ylq8iYwJrQ4Dh7GF5vBilNqPyHlI8MeGwo9ansYjPmWHPjY3ahZihmkQkzo\nikCuIXUsaePemtSZ6CsQ7YyAdwilnN1W4Uln+5BEZrMxmxtEFs0YbRXJfemf\nQGI5\r\n=rbgU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVEYlNYqTat1xg8eqVBKrpBZ2DD5+t92p/wuJtspBURQIhALbK0hbR5czcg1rYF6NdX3HZEC4InOgGRVz9ksMCgpZb"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.3.0_1533968380894_0.2542854341632155"},"_hasShrinkwrap":false},"6.3.1":{"name":"interrupt","version":"6.3.1","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","json5":"2.0.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"35a60e201647c8f0c6da9d76c0078300267774c5","_id":"interrupt@6.3.1","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-DeN7AqSqGfbgartILQyxzVaWxS8vLIn/y4TCeT9cZlkkpGoEuskOQFYzNDk7Zrk2EShikPmkUbyetH4GL4ROTw==","shasum":"c11089a218b4299c942eb8a6dbc9f65c87e4b477","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.3.1.tgz","fileCount":6,"unpackedSize":18811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbenv7CRA9TVsSAnZWagAAN4QQAI9p4LJAY+ZGfunmFz56\nl9+nG9Q+4DeKUnEZMBMglgJXjUsGyk6D9/NLGRaE2Qk6o89jF1JMxdjYs2J8\nAOce9/rNhYrjBefhuARykOIkNlOn+DI3A/Rliut4fy6DQAw2Jz8UNpCl6xVU\nfy9vnC+tRaiBiYKOmkIsmKN0wcfYbP3ZhH1t/Bmqf6UKciM4tiXKva599+H+\ngLOHKfX5L+ZMIuMKQvOG+bc/BPBue48hMbysUVEpH4ixIlWMHVQU5QjPZcJK\nAEs76qmxwUbKYJrDaR8wav49YWqlNn8rpe4oMePFoZSe6QYUxRllkrDfAk5i\ntkdqN7iTqeaTqzPPrgz0IkEkFkU/ROPKq5m4gFEXG5ejK/qZBUE7kQxMQboV\nyw0wOc8Dp0kDF/k31dtlo/JmOAtFGU0IJlZx0jDe5sHPLCkoyHLYwHUHjz71\n5szU/KKlVT5gGmfGFQ73ipumb4VdjJJrFd3S31Vgt09le/AFWlBjhIzhJTk5\nC8YxyU5BsJXS/KynhkA7VWOIipWWmBflQQY/aiB3t8GBBhKFLarhCldCu2tK\nFW/dvdd/UE8RwMqIHi1okK4OEOD6rqj7FlQl8KLIe4h5n96zFO5x9cxlfU4i\njRcJcYpgCAWOtGZ7WKR2aYga7S/+BXJuBizTcXKLjuXAwc/EfIRbBL8vej0o\nYr3Z\r\n=Eu85\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIECiTAOkpP5lMm/a5VKYrN2DZ14oCPCnTSIOx9wXubqUAiAcNXO7fG9ph6lqyKlOnR9os6lp4FPYDCX8TjIyp0pUyA=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.3.1_1534753787140_0.29700024588613627"},"_hasShrinkwrap":false},"6.3.2":{"name":"interrupt","version":"6.3.2","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","json5":"2.0.1","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"a905e8ba5d6b8a91f9aa349649089985ad716d1d","_id":"interrupt@6.3.2","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-QuYgwVA0+yviVkFSaDa3dpzkG69BZ+34hm4N5sW3Ice7OllVUP9gk0nu98RP5r6ooygutEahXen6iPEGXNiuPw==","shasum":"5e90ec5a4f503775f23fb4e0144fb242242d00a3","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.3.2.tgz","fileCount":6,"unpackedSize":18809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbi6HTCRA9TVsSAnZWagAAqj8P/A4IyrDyaJFZ8kpw3+cO\njdJzNkgLoHI0U5CXtcgtAJOsGlioBJKitrI81EZKY0321/g5dD2cWtf2N4NU\noCOK6t1j+MafziU6KGZHhyz55VPnKJdP9X3ADAIux8aydIBud+/VdmMme4Hl\nCHXeLqKgmAkN9hZQPnshdt/ZjTgeieXA7Ii1fZuLRcwHfUaySEzNuo5dxGXM\n3o2E0rlOETzaeb2ZMLCAfXupNV5OQxIrqzYrFMVIaZbajNcnwCjXoeBJVny+\nPSrgZsGLOuhvOpB0zNYAAyiVCopHidv/CVj7lF9TQ6xp/mpNiJ+qlGk8dtsg\nXIvBkr8SGh/coN95JxpYVenAD+HT6vHa4NdRwOBA3by9GDJjYgxI1wuxDd1i\nvEuFh3+vL0HwAr0d3MDjVkL3eOAtjwhTsQz4TqMeHisMomEqCAWLNx1jKQte\nJlyMNsDF+WyMLkTbzvqIDWWrZdvxxND7pBmnzo/12Mkn5TlEM3GRzAVKXmHO\nn52O45p0QJWagMGHFIKAXwfkfbWBQMuIUIDSWpgJ53J5DMerX3YfwwrubnhP\nnJeoChEIEbRvM8xtxXtBzv0SymcgMR1ZC9flZA6GsKfQGJWl5vJKAE3gwwk+\nHqkGOne1AtF9+KwAF35bYUjem9k0FwI83IF4FXPtxmj6UqtoAfaLHKZ/mH5A\nrIkl\r\n=P+GU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDktD8eTXD30k/Qyz6c60RbNIIsTpKJxy8AEt87r7N2IAiA6tZzKVIS+916Mx7OxrUAtJXmxcNaz0PnW0oC2GqNqdg=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.3.2_1535877587002_0.3497461319202244"},"_hasShrinkwrap":false},"6.3.3":{"name":"interrupt","version":"6.3.3","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","json5":"2.1.0","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"4ded65abbab552b33ddb4efb506329ef8dca489b","_id":"interrupt@6.3.3","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-LtyxbZ1Z4hVWPjrMEcYG8iIjDx1O8K+WCEGHP7X5i10hhMQm20EeqRHw9YQDLLDBS/1EnUWjGvHz/eqj2f118w==","shasum":"50f0a5ff8dc11c8aa3a73c436a10ca8986cd818d","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.3.3.tgz","fileCount":6,"unpackedSize":18809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtw/7CRA9TVsSAnZWagAAWt4P/iwxYg+3DZvZwCg0Hg3n\nbnWq17fGVBxLK1LDcQN+MKe84ZovbqSh1gwtg3eqUqTdWWin+I1ktY1oHxB3\nwF1L0yVi9t3Zl2qOKgIucH6MWLWt3pRHQI1CJpPj43WKl71phxMtVqpwt/0p\nXZ9IPsQMWoWchjPw997balYcZk8iTzRYzbn2ZY5TpA/3d+NY+QnwEAFhQ7cx\nsY9dhznKuTWatpSD64T3n3lurc02hdZmgOSls+NInPduPKAVZ7mUg8n4W5Y6\nirM8zPTXzDUfNFk4FTGikhgz2Eu1nTUcJm0IipcwEuxJzvK7fv2HJfz95FVX\nFsR36zljMQOfGGT0dkgbr9NTyBAvBZrd2W7E+pWAXG+Ifjj2iGRuhzTqGSgz\nhgri1Rrdf1RhZo28gx3eUcWl5iQmQ2mRYebnDs4xCtXreQ59CKkYPXyJg8f2\nwlMD/kdXLZEVlbYl2Yln+vLr+6EKX+VBwHuDSedqQWuegQ7etGczHk5dPmnc\n4Zsm6XoCEZCA19jjiqrDB0gtGKxWxG5BLJLn8nXpQZBv8vXlIj7EnP84yFss\nBTyDfVgS0ivrCxf9ISKRaS5EMlErKU/tQhzB/Tfay/zUYsRcatKIusdmcSmi\nXRC6JlD3OVquSqBGdtfc6yh4I4a3uJSw1+o/MkAZHgLnRrqGMZASsOsxnLQz\nqNtV\r\n=Ofu6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHQua6kufaw/CBs/aLYrPS2K7dpSMYD0C8TaLmx8QuXQAiA7bRGw8iGgnlmtTdZGvmDy08rUxjsN07p14j3S7TklXg=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.3.3_1538723834770_0.17715016751706947"},"_hasShrinkwrap":false},"6.4.0":{"name":"interrupt","version":"6.4.0","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","json5":"2.1.0","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"ca5d26b8ef326dd5e685c04c1a786b50b92c7a94","_id":"interrupt@6.4.0","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-DQ4wp+Leb/0kWeK7cYoPH4e5JCFJj6D8Q0rDNIzn+YSEVEqk0jX4b2vENxdVIPhxxbxbNyfxE4zWD1GhZuqkOA==","shasum":"57f259a029d26b02c08fc2f0cd8d4a56f2aa277e","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.4.0.tgz","fileCount":6,"unpackedSize":18747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8gqJCRA9TVsSAnZWagAA8L8P/AlD8SryBS/D3oaG077b\nyNw4NSiq+Noz5nHM4nXmG3nzmS8TyeMnvLKFyULkHy8xmgfxEWGRyZf/CVS6\nBnaKGfDFByAf7RoZ/S7G8PC0v36abG14+/BQZThozH7NP/ywPoGDUAqle9EN\ncn39ajTiPpYmi4EM+TAw2hX//zhk66Q2fk/d1Roai/EFP8D9M/VEclrMUuet\nsacSrfU4S5b+knBNAiBH0s2lbrsrKnsO6PTZI9LGoV6tYBhIBJCwV4lVMB+Q\n7Uv3ACIhKKP9Fo0hiX7J1EHjQS2PfRAThSQOmWXUEnEwjaro50zAEP5SjDy9\n1kBl3iKm4ql4R3X4RkvA8hXr2lUSPNYRblLjmjUNtIiHJuCwE2fC3C0WPYFc\nwdsQOj9lIyWKRwulQrKM6x0IgpbWmoAqduUhreQwuk3IHAzSLXqtdh8ycXZQ\nZvcuxhBxiICPdr4/byPfOSmNx/PQMLH1K9QgxvRCsLlNa9Ay6ioaoWSsllrU\nSS7leXRop4+dtD2SU32i4tZTphabjilibuWStBjCkIA02Ir4VLpeq5Cxu6Vi\nPNU/+VmE1hKLhnEC0B5a5lmncZ0Uduxi/EfEKPc5LJNv2uYDKf3bWQvrKuL8\nOPopM2aqp0AGO9OxIqCovU/fRQX55OEhkAzEljUDLahi9c5mNA4mpoYp0A7n\nV/tE\r\n=516c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBuEM7WG2VwMv0RhIDUY701WGlcKAmIHI3VEJHO4mR+PAiAAljmWowKLI2gwuZwEOIf6qpPXl4P5AWSh4h80TLwZhw=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.4.0_1542589065077_0.6396296950508544"},"_hasShrinkwrap":false},"6.4.1":{"name":"interrupt","version":"6.4.1","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"3.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"cea52101577e1c3e9abad384c62ef752e83a39c8","_id":"interrupt@6.4.1","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-5JeOCcgnc+snGXBkpABx9nm/drQtaRNKl6dTbHG2fq8Z2Qq5hXdDty6cznEpHGs2AsbvOto5vdX0/fsgTXiHjw==","shasum":"bac6b598ee77532c590d03b7eaa7b29713e2c659","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.4.1.tgz","fileCount":6,"unpackedSize":18678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8gvGCRA9TVsSAnZWagAAEmAP/19paexN8BxpNLoWdIuQ\n7RPQM/xHdRBiWkWZmX2WvyRdrMXfj8c4BGQRkkp2X7MEgFVcmjf5SWPVOCb0\n4HW99GJBxGIXWw1Kfgvy15QSbEum0MOZB5abyvtBryafRWQS/SK1Jr4BccWz\nwdGZvIyLZBze6W0QZZ4IkLlF7BLc+zH2mKWUJzPRj6oKYYXdx3da6H1CO0YH\no5zCRSvOhKnOTl4faG6qILljH2+r9tNCJ2/aubmIyQg+h3kmd2a5ILdi1JzP\noav38HMicyMsSc6HPhjLPCbnljXGbZMyUienMKXE1+JzRq5+VNkTQDnKCRNQ\nFbQ+378P1yEeZgL+NqYzL4fjLXYFXjV9edpU4LNDx4XYubAR+KlLQrRyjZqU\n1QEkwP7c+7WXc3ei0Xx+Vu9ojb2t6lx/NiEJjxYv+DPYtE3kbYbTj33JoJyJ\nesUe0dstph6XJwt//vZrvNZ4yAPPG6p4knd8JaGcUsc2D2MyOqMHTAkmU+x9\nU7rFI1vsglu4ZSx0XaoerkHogKkvsD5/X9689aNGVy5Q76DKO4n0PQgbZsVV\nDJYr4Q1dvKg/qCIqYhe5uwm995Ll/dRMUhf45aIUpABJuwLVw51GuylMzKtj\n4aeGfa5O9bj5am/Sw5xEiHxqHtYsx88op4JrsfP0U6V8uNKEBxwBqDP8CE0G\n92to\r\n=1WLN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6n+1osArN0AeZlEdoBCs2kXOZhJrJdigFlY0mpVpbiwIhAIqq47WLDkFrgh/xTbMVDlaZnpbLOpCaOn2yprAazotP"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.4.1_1542589382118_0.0009620092733884089"},"_hasShrinkwrap":false},"6.4.2":{"name":"interrupt","version":"6.4.2","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"5.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"87d54015d92153265e9cbe630f03e8d28f30a7a9","_id":"interrupt@6.4.2","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-aTIzDvlSeif8UjGLuFvJ774bG1jH6ICwk4TFiFmL9X9G4pRLx6uB4anZsezU5xMs4jtOO4I7vrP0KIcPTJXGjg==","shasum":"5d64d99015f26e35229a84708e92c64fba0433a9","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-6.4.2.tgz","fileCount":6,"unpackedSize":18678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+mAfCRA9TVsSAnZWagAAPbcP/RvsYDJHAY0kFphfqM1a\ns43jo2s1fEsnHu+nrLxPs6XFKErnHgz32iB13rnsY0xbWwPuF8wsON1RdAWI\nqKgp4e8sg/EPjuYixdAuy/0sud2/y4YktB3RLlbNDYEIiBiDbEycYwL0z7CU\nZbdw4toNQboI1Fm1nYJJKfuj1bXei6VamZX9Fb8NV1Pq/INse+g6geaOcRMC\n4yXf3QEcOGn/RzisSfORtL9O8L7pvXkY/wzih3yW+8skSo4Mw3XQHhu56+O5\nBymEWY/SD85GX4bWcdl+PiUFFdr77KzzC431tqAl85lhtQJ7CoHyUWSa/9C1\n9uYzxIzoFPua0WE4tVs296WElInZsh7YdggG9V+BNqKMXdJC0rLqBnh9jp2d\np5sHd84sHerxhw5ROP7UjCcmuZR9JCH/aL/ztzSjd+xgv+cGT0x5ysx7/RvO\n4BFof2HdZ1ctI8Ruh6kH8qtTIWhrSBVlcWdMm+QlSni9NOC/RK5wY+S1Z3ou\nJrrIHB3u7qaQyjdPM39gdXzVFXyT7qZucL4sdkv+H/Fdt0o8ZaZjHj2kHkhP\nsxWMaL6Nqfwd0AwRldBXtyLy0WCQ3/7pFJY+bqlBTSeld/VRLBD5VSdzJbun\nwnC2681dFi3aQ+8rFLYKsdNVhEhuX5KdbWLkAi72luaqDTxQvExFhwwYvcIS\nRFcP\r\n=/5xX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGducGTFn/+Z+EHG3zGwX2niOH21qQRCLwUD3GzibwI9AiEAjz3OEhLIZoAUUDExrK6R/GXOcKpVdOVpJoVGGyaylfo="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_6.4.2_1543135263269_0.8214882137886812"},"_hasShrinkwrap":false},"7.0.0":{"name":"interrupt","version":"7.0.0","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"5.0.x"},"main":"interrupt","scripts":{"test":"proof platform win32 && proof test */*.t.js || t/test"},"gitHead":"97abfb3f95516258bdfaffb12112c7750d03b987","_id":"interrupt@7.0.0","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-Wg3x4ZYE49u+Q4KStYJQyglMdTTsNWJm2MEUmtZtOdCq17a66qOUtU3Mtz7uZRfHcHBduoM3TL4ZBh1jvmsULA==","shasum":"ad9c197b990b8088d1ead382e0204abd4f41528c","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-7.0.0.tgz","fileCount":6,"unpackedSize":18678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG1U6CRA9TVsSAnZWagAA0bIP/jZO7KxeYc6mlBTAMN24\nbE9jALKI/fsjO2vof0AwSe7KNdhdSXDd+OuUR9GD16eiAe90hazKpsYKk+NO\n2x3i3bShttcL/whaa8/6SXSdSE2Q9StTNz+uneai2h3u1mwmzuQfIUgG0WFQ\nJHazRnviFhDt2KuPR/lUcvQEquIKEVbo3vBGS5ZmF5FyLhyFI9xtRAknHHKq\nx/s3UXL9flLlFMPWerkdQEK7vB7yWvVzlLrCUNoife5fohu48jlOHIQLsXzi\n3scM6tzRqWCc9jNepDyqQgylN+T3K6SNKR8LLVy1amRdjlGAf8ZUj/S3QMRF\n8xoJBMXDI66OJw2B6vYhOU8HtJstN30ZpWxj8yP458fGz/9mXOtBprOjmJul\n1YT86YFOL8lQQ7yGuVuyafxjm6gGfAaXmgbqlS6wvC3p2VW9qnsuV3EKXmXk\npOK7PYhgA1BDFR+FW+nF+b22HNr2aI7cP39Auok0GWqOd0j1VdmPGU+IGJKr\nZq1lfbOxtF14MjTgTZ/FIRyDPrTL8WiTVfX1wU6KqRRNMmeJds5SSKb7Sbr2\np02DdepQBVO5qTy+oyp0elHO6CFdYN2LpZJpslpJddRDhw5R3wRWl1Fvz1EX\na9LuUhY2pYweqTerdphvOYctYFFCzW2ucaK6Jml6dwXMYTGIVt1jHeyuz/jq\nvIYB\r\n=mKoq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbYRaujomXR//0T8jSb80LUyELCvk15GM0Ld9st++hVAIgEVXLaLQq4+2Ph/DY9ebkTxx2fEGYA+Up8mbBHij1wTE="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_7.0.0_1545295162139_0.04064164021519634"},"_hasShrinkwrap":false},"7.0.1":{"name":"interrupt","version":"7.0.1","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"7.0.x"},"main":"interrupt","scripts":{"test":"proof test test/*.t.js"},"gitHead":"e065f598f72834af8b5151a92aef097b46540499","_id":"interrupt@7.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-za4RgSX6lc7f7Q+oxrbM+9kAx80CxMIdhmtD0MqjW8sgv2fh0yflqKLvgiQ2V54Jo0kpPv3Ge42P9FR8SVevng==","shasum":"2baced01a75bcd13896a085d33d9a0dfcf9817be","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-7.0.1.tgz","fileCount":9,"unpackedSize":26082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd46rCRA9TVsSAnZWagAAE9MQAJqj6dS2XlbRat7TJcD7\nxFj+3IdZnP/bO1hZNh1WTxEOPBwF6UN7UrSqoHINxyQNRZx+ru+tfRx928eX\n0dMZD1jkxd4fMXwHA1Yw6hIPwheUf3ePXxV3cPuegH/rURhLYmvBVs52R6hF\nb8Hr3VDeEvHVoZNXyGKSK+FSz3oleeR12HGtJZ6Lho26oszyZItIpy0UAQ/Q\n94UCLCmaVoMJd57YOFjxfx4596RDAQkTzI26pHcoE9n+s4Zw1HzI4565D9PJ\newvzXFZwF9K1KNOgp5SoHkekgXQOY3ITcFbgQAZ3D20vgifvjDGrgYDJSdam\nyw0PRkJMDZ76qzZbax21Blmj0wFvGOb0zTnZR+gTU5BICCj3hDLnjzosocnl\nR6ddtPUIFholvNXZ75fETlEN4E7Xyi3taMzR+WvTUKpVGQ43XhSBI2wq4LXx\n6TqZEk31fNPQQE7xN5EF95k3n8N/SAXE5Y9t66DWsOgVbtUs+85ZHVSxZ/lp\nMB/DLu23jfh8znv9GTquF/7Wzf8LQjIEZ4yUArd/rODaiYkKVxaOaCBXlxij\n8izTyWc14v36PTEocAL61DDgSxkGCg3F5of2QlJQHIvW8LxbUrD9O55M/w4G\nfsm2ZFeTdWyNCpvCXhHNE+u98fRwkgPJgPf7ZJMgVjmSx74MRdyBlser6RBn\n/BsO\r\n=LJa/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDo0rF8OxjzANoJnzlJV3eyIMHkG6PHo0CpuTe7mRp/bQIgMM1vcSLxDV8YPI6sHOX9gHJPUxT+wVQys/YWdHLncSM="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_7.0.1_1551339178285_0.07884407901049628"},"_hasShrinkwrap":false},"7.0.2":{"name":"interrupt","version":"7.0.2","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"7.0.x"},"main":"interrupt","scripts":{"test":"proof test test/*.t.js"},"gitHead":"bc1734be39fa4e62b0a09ac49ce854f08a0c39c2","_id":"interrupt@7.0.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-wy1mWNt7/SEVLLSXdyKSkw/tcFvtT+MzYrzNdYrH3ibJabeZjcyRdGuWy+bWv3ioyCJyN0/0Wy6QZ7GZQARmzQ==","shasum":"93a421ffe003ca03a918567b301b9fbe9680f8c3","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-7.0.2.tgz","fileCount":6,"unpackedSize":18647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd6SNCRA9TVsSAnZWagAAuo8P/j5yzdajniTuLAjAx8YS\nBfH5KQpjBblFNgOMzHxL9XulmMu0WcP4TI1tEyCYOqtgTf4zn9YT45+ttshH\nkg07QV/lDxuCEv4mScb3z6+QHSTy1lujmqRx9+ldQoCM7JMcuo0phCDe1V01\nCrLSroU+HKZiem29iws/c1UWPi3F5MG2VIxgZN2tSXWEU/y+7UZP6Rhd/9i3\nnjuCtucNkOQ20+s5Wg5gJSuTOruh9NQT0meOYFovkaiHJqM/etEC+Ww4oZhK\nvZiJV2MHZxKf/yXQ+2eS8zc5nHNc/Ld6oxnFDydowfA+OtRnYkjnD6oyjfzK\nMIVzt6GTS63jh/SghMiJkWKCDwIyrSYakwurp1l6zx3HNvJF3rLHNNwgiCBj\nHRzshfW6dp9BnkLWSO7qLIppyQtfrN+B43HX70sS//IcHX4Cf/XWPNPm7NSk\n2xm5CanKperk9daSrNEiQNXGtHYyunB+tybBYqoANLwHtmvXfDY+7U8PEilz\nTiikYHvrZwmaXiQGmYHJm3AKHld+nGJIaJxTXml3Jg/AfA3jGpyltKe0vYc5\nOJk8kQkeLKR9jDJZpcln34VVHknBBD/A8AjXqMYz5vmOD/K/MwmX5Ipy1vzx\nRPI1Lk8HfYBV6EHO+SHSdOqhBh2eAn5LoyPcnRD+cpDwah87qtqDjDHNRI26\nZ1xf\r\n=7wHm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzB7cBDGKY1I+lzjZ35LecNiqdvx9kqBA+fDpcX4NB2QIgaToEQAKLGlXn0ljF9kkCU0D88CKV9tRCWnFd+QLtHrs="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_7.0.2_1551344781407_0.9079382884922518"},"_hasShrinkwrap":false},"7.0.3":{"name":"interrupt","version":"7.0.3","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","stacktrace-parser":"0.1.4"},"devDependencies":{"proof":"7.0.x"},"main":"interrupt","scripts":{"test":"proof test test/*.t.js"},"gitHead":"849f6d74bbd051df4074bcf776fb155eae312e3f","_id":"interrupt@7.0.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-nPZmf2a/oo7sAw5pVVz4yb/YzWe1HN0bNeY6q18BQwf4gMGt2if2xEOewB7UYJYUSX81CmVNk/LaJHhoQ8MbSw==","shasum":"6dd0408cb9a69b14d19885ea2b67ea30a3cca366","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-7.0.3.tgz","fileCount":6,"unpackedSize":18647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd63aCRA9TVsSAnZWagAA1sIP/AqzlDJXK2D+22DtgV/m\nMMboDtzs6AChsziZ5VbrKJWgFuh83uMwNyjtwVmz2++yJ0PegCaB+kMZVljK\nHxn4fmsCgdl21k3TnXJtJ77GTFo7G8xyUFofNQ1hfp/okHpYR/5BYQ/ua6NS\nJqtAzeyAymzfZOFQ4MjdW7kaCY1fsn42sb+XdwgG3X7F67Wyn5Amg59oo31z\nQMIHJvco/x4L/V8OsLJ0qqr+WqwlICdk3syUYup762XloRYGwK3W+WV50HG0\ni/eS1r/pdyBnCLkIXwIxr6DmwepIE7NUKAgs3zPuY2CBhPv/AWjocz+cnKfV\nwz9eYRXz7OkFrIUnT5vesW/44oFgyRqlCAsBsgBsthArplXgsUckt1uT1rux\nXwE+cKr6YhSW1Z7MWX1EDnDJ4Gv9i1UXq38FHyvzWjto7xNuKyWSK69d4hGl\nX8tPHmPJhRlZ8jvVBAfIvPn4dxGLqh3lZExTiiXC2tpRMkv2stooEmfFcMwq\nvwzbnfdBtyRcDRzuYj1zRB9ViuryTGCEmwK69YFQWSWje+aseQgM6beM8Jdt\nSUyLu0ZmEV4Qureazyku/MnRaw5PArJodrXe5DzpKTYHC4KKBb5ThCPqFm/o\nDW0tfjmY9CM766AsCQko4Vy49De6q7O65NO+zznLAPVYGBe5k9W6TZf9l1u1\nJF9O\r\n=ysbb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDULLx9zb6+z2WXc9j3MsOT4i7c7Fl0B4as5bOAaaM/0QIhAOvZ38yxPV+0a0/Ww7bxnUHN6fsBLtVP0v2gtHC3+ZFS"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_7.0.3_1551347161455_0.5160970495454806"},"_hasShrinkwrap":false},"7.0.4":{"name":"interrupt","version":"7.0.4","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","stacktrace-parser":"0.1.5"},"devDependencies":{"proof":"7.0.x"},"main":"interrupt","scripts":{"test":"proof test test/*.t.js"},"gitHead":"93712dab4e954fa312000e800f599d00f9e8ad44","_id":"interrupt@7.0.4","_npmVersion":"6.4.1","_nodeVersion":"10.15.2","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-NDFnzpzItP3o4erBUsgca1Wy9i5XaF1PwGPG9lLYTlVRvoPx9VTQ9NvPUnpxHkz7CTS2mXHyh9ASSQKYejiHNA==","shasum":"db0ce71ccc5423ae798fb940608ea2950e67d775","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-7.0.4.tgz","fileCount":6,"unpackedSize":18647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcqojACRA9TVsSAnZWagAAUgAP/2dLdOjJcwYCbVJztv7n\nu/j+ng7/41RhISBkKWHGXjfxboEeZTVhH/3+KPw/A3Af666LrdnjbIJYoOzb\noIgQdoo+U6v18yfkKNIYyyinCjfZ2MNUyL2F54KIsFwyOggiSub+Oc4z9I0r\nVHVZnwXeNrlIBjfqnkBkF2GvCwEMbAA0uJgJKemMWM9lhZHVg6qWOAUZyRNL\n5toWJLJIna9e1CIlABTD9+ZpadSc32WfJLFI7oTe5VRxib/QWjf3Bn3cIoDM\n1ld4aR0GVWLRaSYUq4aSRWK/dz0lEphowJeWqnd9uFGaU0fVDw2FQsttVUdF\nKEcQH2LhywXdU3SmAd6xc0oEbrsKZ9nlvDwqm+s7vMxJovj50F+1JC+FMu1K\nuouqTVvlIVD1uOSWtaB803UHl63ZgydWOvsGMHkLjdFIX81gy8G068Pmu412\nvtw655OKsKv4Pfztd5pQPSfExlQ7yhQB3T9QMlMQnouxIvFL2/bDInHQ32lf\nmW2rqt72dpblLUBwn8QpdO8MxFTtUBJrBmQu5vTqWxiITUJL5OQOqe+whUGs\nOitSH5nGthn74Qp8dunfbZ90DUwbOs+NCR4z6htozWq12JYHvCYOhgbPiDNR\nRKazvDUnbyXGwL9e7fa+B73e3ye1K5DXtY/RB9iDa8ebEd3vGoLn3gGdBMDY\nIljJ\r\n=wGpL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEXpUtB5vxe2Oj9o4jEVmolSR+B24wID1mM5G0k9uO+TAiAy9iUItpLRUzw3MjskolMVRGnXPU6mX44hsyU6l40YMg=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_7.0.4_1554679999465_0.4934955050254741"},"_hasShrinkwrap":false},"7.0.5":{"name":"interrupt","version":"7.0.5","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x","stacktrace-parser":"0.1.5"},"devDependencies":{"proof":"7.0.x"},"main":"interrupt","scripts":{"test":"proof test test/*.t.js"},"gitHead":"fb27160e52503e919d724c9ed8b5dd5783e9aa10","_id":"interrupt@7.0.5","_npmVersion":"6.4.1","_nodeVersion":"10.15.2","_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"dist":{"integrity":"sha512-ghADtYAhiJvgm+jNEWruX/ymnlxPoY4bAd45NDkCr4IHv/NtBVvctDV4N2IyvBzTbF/BFxZs/bAhBkUHsrTwHA==","shasum":"b2bdff96f59e5f1382f1bf897e75a12696d343ba","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-7.0.5.tgz","fileCount":6,"unpackedSize":18647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctnUbCRA9TVsSAnZWagAArs4P/2WTR0rHKs5kOAwaqi+I\npguPRAwAdnrwq3LErgZk1mxXjDSY9StnF0kYGU2jfSrn1WKvdOvigJka5Kwq\n0zoK/oFZ4bqtxIc5LEITW4XqR4hOTv4qxnS0RXY0wtRiHXUlArK41aINEAE/\nfDWYLtkeGsa6qhe5PaxPJUjpCuu/Uoh1KGEvsLk7X0RetiJSpKz9ChKyohEw\n7Zu/9Ymev0O47ZA9TF07CZNTF+0ivFRptg4EPn7n72qH8TS7/ZFByGrPg4ha\nAFuF52YrzQAY4qPWUCpmPlyARuUXzB1HB/lr0fERFXhOFwhroORds6vVUoyB\nXRLOvzp5KGMjGxoUi7nUIXuoYGZdGpkbi2G87InhAszBwOWoSMs93spScc6v\nZgBlT2VoMruo/BkPZGQnjtsK/MJSajwXP2gEfEWJFTA0jV7L3bKK8l7Q9Nkb\nyH0UMlOv0QcxtIuZ8qdmNy5yGECAla87JPTQ2v07bsJDUOJKAGcyCT4avZq8\n0y5l2jrk/YBdc/JQEMLRFWndgZH1NmYDtx5w4GzAOG71vpd7sFCJhc4Pqhk9\nPZf94wY5xSfC9WnqCorapVzZ61P9kXinqTwuoBS6fUgkM5lxRBo+4/07ECrl\nBgAaSyaJGMcJWchQRT5CYe99J39WCIHuaC0yXeYIaRFtvcc9uw+rzOC/rtQl\nwrVD\r\n=vbBi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDXQZq2Ep1vTu+IghewHvuRTFIVf/1WugBixWCmpkWPpAiEA5Mka2PpMzjnov1GesNfWlL7YgaVn9HyiuXkCVehMWlU="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_7.0.5_1555461402950_0.8702946304721659"},"_hasShrinkwrap":false},"8.0.0":{"name":"interrupt","version":"8.0.0","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x"},"devDependencies":{"stacktrace-parser":"0.1.5"},"main":"interrupt","scripts":{"test":"mocha"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"0116ea3d23bfbd124fd15d1bcbbb71d7886ff826","_id":"interrupt@8.0.0","_nodeVersion":"12.1.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9AhCsXM5hZH7L3NEq6D5EVFNWSp3XIQxMA5yQqqLjkf/QWXKd7w25+zxpwwduqXo01SwdyVpWYDds9SbrLLnpw==","shasum":"b25f94b21639233a82f876e2d27188045a3af479","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-8.0.0.tgz","fileCount":5,"unpackedSize":18552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3gBbCRA9TVsSAnZWagAAGMoP/2wZZXqe/qYNQa7Pg/1I\nBTqVsFkOYnnqsY9k5antUcyYhK4Yj3gX5nTAHq10Uwqz45o6YEpRhRJoJu9p\nse1y0cZfkeO5zluyloE2jtnabNLD8DbuAoJpSIAarhJtZ0okFxwgFVtdUkhU\nupgU9DEU5xtwyIrbXmKfdc/VluBwvjl+JALlZtxl+DJrXIGYYdhealT923XZ\nBGaAZtHaKnCKlPzeMDrFoKolq1LM9iL/XpG2y0Y1VMIV1tEEOImTjE0qTBF+\n+dS+z27/JHq4P2pxI72qx976CsUcaoi1IbzESJNtm60fwjzd7tCB5BTLLdtb\nbIyexu9IMReGAK9teXhTh4Jgo9U1rtR/ck9lODSBBu9FluUmILdwkkWu3NFi\n7E9MmxCxNhT86Vumg2ijnAnJDL6Pb62yX3uBYXnnd4gMxHzTcsAzc2sNLUeM\nSH3G2enlj+DCHDsV/u2A5FAufXj5e2IIQq1otlJ8Gyll0/UWlhxmJMqtqMwq\nCXMBjs9T5smroJOLPwm/9lndT4t+gCWZUqzgqCwJew4gcUWCRohKiku7Ofsd\nBTRa0ugFGRmVGhx6+S7a3HT5vgVaDKsHAdC8FJSe7ZZO0o3mqKrXSn6gBSth\nOKQIuZNRc+Org8ZU4I9pqp1iTbabfGGNlDCBI84votuEm2jQEk4wtBXUaWKh\n0iNI\r\n=r5O5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7LiGhymNSQHCdPlcIcuNZY67SQazUIcn1QSvDjvQHwwIhAKmoRnV9TDmzKV3ASjWGZxie/O9X5ZwkobqiQSggVKbm"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_8.0.0_1558052954830_0.7032576571079794"},"_hasShrinkwrap":false},"8.0.1":{"name":"interrupt","version":"8.0.1","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x"},"devDependencies":{"stacktrace-parser":"0.1.5"},"main":"interrupt","scripts":{"test":"mocha"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"e11fc81e58c0e248e43ea77e2916e5890b1c9313","_id":"interrupt@8.0.1","_nodeVersion":"12.1.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-X4x4lvt6n8N3vbL5qgzEIGSLWQbZ0uidv8+vfFzoTjcKkN28GfmBaP14P0yUdGzinx0e8gBYKUg91OYHMPoGZQ==","shasum":"83d8ada624944e06e5dd3803d46e15c58359b738","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-8.0.1.tgz","fileCount":5,"unpackedSize":18585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc4IrLCRA9TVsSAnZWagAA2u0P/iuarGAhylY4tj+fj86y\nLk9zusiZuaqJOjHtJ4g9s5DfTKw8Rcwn9yGIGHBucnQsaYt9UNNgqkQnN/qp\nGYm0Q99IbylJXshTdz+rYFxFAQQcvIkmWuEGHrr3vDcB+RalEBOxXndIHunI\n6uaHJHd0uyF/rSyIhK/4eNfDos4yuxm1N5S3Q70OvEX8W/eNg81Zw4iY+UK2\npZ4xqdi4ohEiMJwiDsukTXsdA2t6tiidnqQDW+aaw4oqcgP3GOWKAJjl60Ur\nADSn0CJcrGMEj5RCkLfgUWn6PQUKWmWSA6T0MF/AwM/bAO2p+ItjkJypb6SM\n1beoD+qFuV3OHMDPnMH1VQysvJcxXhk4Oul6kZn9R0pbxqn4btwKjJEizXMn\n8ClDEkuo3VGjrVQoW+c0AhMJAD1XNZ24Jv2LvVqBYK5RDsvzSLFxsMPobT+1\nxpMRx7GbCpptpBaYpWC447v0OwK0jvtt8VVf9pAbKmUX2Ai+jcRAHO2nhCfP\nt8s3lhb/wXnkhQPimvFaJ4O94x0bgHOs5x/PQk6vD8u70ssbvbUnCWEnmnCU\nS8oWMy3wSLYuVh/tyjYXzxvOCz3fVEDgH6dCeOSYlyLmstwlLJOaP4FDPUhw\nSyRNAwRWH993PAON4J0J80RZiRw48BmVQjyzN3Ui7nOa8KRr07Ek6RvJGW1z\nWvdq\r\n=FA1z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHEgJU2r8JuAad0CwD9VrsujeRqruHjsMd1Yu+PoQJ0HAiBX9ob/Ic2XqAFtJg8BvH1Z9mi+AZ663nAKYA6/FFzPRg=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_8.0.1_1558219466545_0.21783369166440436"},"_hasShrinkwrap":false},"8.0.2":{"name":"interrupt","version":"8.0.2","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x"},"devDependencies":{"stacktrace-parser":"0.1.6"},"main":"interrupt","scripts":{"test":"mocha"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `Cadence` which has a nice\nimplementation of asynchronous `try`/`catch` that pre-dates `await`.\n\nInterrupt is an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failure on\nthe command line and in my server logs. Interrupt supports nested exceptions,\ncontext for exceptions and complete error reports on fatal error exit. It does\nthis using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [addition work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type based `catch` ladder.\n\nThe very useful stack trace you get in Node.js is a Node.js specific extension\nfor Node.js. In order for `Error` to be useful to Node.js we've had to add a\nnon-standard property that we in turn depend upon for meaningful fatal error\nexits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates and `Error` that is specific to Node.js and generally\nmore useful than the `Error` that comes with Node.js. This is fine because the\nuseful bits of `Error` that comes with Node.js are already non-standard and the\nstandard itself is not very useful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement delcare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above.\n * Plain-text, human-readable and machine-parsable that work with default\n Node.js error reporting.\n\nInterrupt may appear to be a piffle but it is pretty effective and easier to use\nthan fiddling with `Error` directly even with ES6 support for classical\ninheritance.\n\nIn addition to the useful report with nested exceptions, the ability to declare\nand error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesethtically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/resuce) to catch\nInterrupt generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches call the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception is multi-line because the qualified name of the exception is on\nthe first line of the message.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"3102f2df821b633ab2ea9846fc7854b8fb72a8d2","_id":"interrupt@8.0.2","_nodeVersion":"12.1.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-eytogCZyA8Qy2sFkYvpEn0dcw5ONmJpPcfEChfCYCWrZLmAOyqnDCSCbY87yxXL7hxoMB439nr847xwNoKnG6g==","shasum":"b868069835918465e8f858531bee360b433a16ef","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-8.0.2.tgz","fileCount":5,"unpackedSize":18585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc4L+7CRA9TVsSAnZWagAAXcwP/AnDRjJO1sU/mtQUpnoZ\nueGdYV2m+6zn4kXXXnwHX9x2pCIqfoKrYFsomyLAdVHlZu2C6U13s3AMsNSy\n6kvAw8Z2StEQMzKhDe2VFGbhJt+aqNqE0TiFErVoi+BaVnrni5DX5dQPDi8o\nS3yvIUztgSyXUVEh8YMU/zYTgFFegbA8CguF4G1iIQc0ASF+DziULty0+xna\nnFUw3IR9/ilJF4L8nvF36m1jvfl8/ASqpWomKWTeXZcmXTqFUDZ3KuG/EUQx\nnhllRVEdDKHrXsimTjr5eLv+vuL1dRONxdcToDXihCihJiuNYEOfLmBCYBoP\npf/i6GY6J5+sBoWI2P1k0UveEz3HwEEjzwJsrjD+lDTPTTRkEdQPA9gVoxRD\nh9E6DWg9o0onwzMS8LJXrKAc3mCg3ro+Hm5EsHQbTb+JCWwnJlFeb3F7OqR2\n7EKaD7IOv+iq+k/Mmd19O3xDi6apdf7GMWThlqH+IhXMI6mDG+DJEN48BXNJ\nFHUjEU5Um/u7NoAt7snBfSang9tXOZXJrWDFRUSCd7pNcf1M0FYfGGMbbmKy\nFhY0Rx0oXicRlwJjevB4G6y4TM63POQcxld5vZubifa5POW32f2nhl1Cy1KF\nz061R9OUFYjKFQlOJZin5lSYtVEZ8bCNsLLssJAusDw/6V1fkP4fkpn+v65P\nq67a\r\n=DXtm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDe2+JwLZ41WDZP71THGX+OEnMdVjGl+g7U08d00q883AIhAI2lPw9hamo2F7SjRQ6hq2TJug4EmslCG9fxYCaKXVlA"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_8.0.2_1558233018768_0.9583533019390356"},"_hasShrinkwrap":false},"9.0.0-alpha.0":{"name":"interrupt","version":"9.0.0-alpha.0","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"1.0.x"},"devDependencies":{"stacktrace-parser":"0.1.7"},"main":"interrupt","scripts":{"test":"mocha"},"readme":"[![Build Status](https://travis-ci.org/bigeasy/interrupt.svg)](https://travis-ci.org/bigeasy/interrupt) [![Coverage Status](https://coveralls.io/repos/bigeasy/interrupt/badge.svg?branch=master&service=github)](https://coveralls.io/github/bigeasy/interrupt?branch=master)\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `cadence` which has a nice\nimplementation of asynchronous `try`/`catch`.\n\nInterrupt as an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failures\non the command line and in my server logs. Interrupt supports nested\nexceptions, context for exceptions and complete error reports on fatal error\nexit. It does this using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [additional work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type-based `catch` ladder.\n\nIn order for `Error` to be useful to Node.js we've had to add a non-standard\n`stack` property that we in turn depend upon for meaningful fatal error exits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates an `Error` that is more useful than the `Error` that\ncomes with Node.js. This is fine because the useful bits of `Error` that comes\nwith Node.js are already non-standard and the standard itself is not very\nuseful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement declare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above and work with default Node.js error reporting.\n\nInterrupt may appear to be trivial but it is effective and easier than fiddling\nwith `Error` directly (even with ES6 support for classical inheritance).\n\nIn addition to the report with nested exceptions, the ability to declare\nan error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesthetically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human-readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human-readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/rescue) to catch\nInterrupt-generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches calls the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception message is multi-line, but the qualified name of the\nexception is on the first line.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"5255ef26465a7b20e3e482b10e6e5962684be7d9","_id":"interrupt@9.0.0-alpha.0","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Y6c+UQD0ZWwvvOa+Z2kt8UTlPoe5j2MMKd4632ufmF3hEMM1S96dWqiDvuhzWWejpRmPgGR22R4xJwRnMEQwZg==","shasum":"6a4d9b79f8e05c6200cda7dbe3023ce2519e77a8","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-9.0.0-alpha.0.tgz","fileCount":5,"unpackedSize":18370,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdfeiVCRA9TVsSAnZWagAAw6YQAIPN/vBmwOWN3bAm/lI+\n6QkbSkYe9bU3piC2aFsMsXBYXAMvwWRCz2UBDuHcSNv3SSfDw+ZEtTWNIufK\nsiVK6muu5IJbIk0PpFL7Mply3OQiTeZ3NU3vKMxX6LRFiyZHj9Bm6pHtJ4we\nBy4RXvEry2iRAVrEkKZYKp8I3k7jnuppvRkcGdAnF0Ta13aYiGWAhVRRd3OC\nzNsyxehWz26HBQfm+2oEYlEte36+3oR3YEjMrOdIhPAtO4bfC+jt8ZjGh1Ty\nNEQTxSUfojL7bkS7vP0ge+iKud1q40kjPSMwwXSoiSX11wy14nosrCR2hwSr\nB9bVJfnWK1aHvvOoXL4SsvNPJYPoZMBVS+wLXAFJrV7t1y7lCrppa702j+bF\nnf4ncVbkgiP6wJUIDzHePvAcCBhJfl6ehJMB49SNPtrbxQpRC3jfCA5oIBPn\n0hPTmm1nDL9jF1dBjz/VxYDF2NWJslw0bUtws6FVbg6thOmelw7epfPUFB9b\nEr0DrXVR0ag/5OXzam2UiiiuIeQIZ5ymVRh6X58mh+dgOe5WhIi0B/QIhKgc\nHfEsQbUu3E8aQSDplDvs4mqzKqMkO1eO5eF3St+c5I/+xqZeM0YQjmCcgwv7\nN99yocrHDUuF8mGuwgxXq6QIJG2reapdxAA4LjKszUkvgSwCjPw6q66cP2iU\nSmxN\r\n=NPF/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEHgnyY00x82rlRIL2e02eHKQEi4seNu18aMpKkhDZ2OAiBDDfKseMgGoTDU5WCzksDK9dn3SQnZ6BiWuwPfKdaFrg=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_9.0.0-alpha.0_1568532628310_0.45847182582467005"},"_hasShrinkwrap":false},"9.0.0-alpha.1":{"name":"interrupt","version":"9.0.0-alpha.1","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15"},"devDependencies":{"proof":"^8.0.0-alpha.7","stacktrace-parser":"0.1.7"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA comparator function builder.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `cadence` which has a nice\nimplementation of asynchronous `try`/`catch`.\n\nInterrupt as an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failures\non the command line and in my server logs. Interrupt supports nested\nexceptions, context for exceptions and complete error reports on fatal error\nexit. It does this using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [additional work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type-based `catch` ladder.\n\nIn order for `Error` to be useful to Node.js we've had to add a non-standard\n`stack` property that we in turn depend upon for meaningful fatal error exits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates an `Error` that is more useful than the `Error` that\ncomes with Node.js. This is fine because the useful bits of `Error` that comes\nwith Node.js are already non-standard and the standard itself is not very\nuseful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement declare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above and work with default Node.js error reporting.\n\nInterrupt may appear to be trivial but it is effective and easier than fiddling\nwith `Error` directly (even with ES6 support for classical inheritance).\n\nIn addition to the report with nested exceptions, the ability to declare\nan error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesthetically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human-readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human-readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/rescue) to catch\nInterrupt-generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches calls the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception message is multi-line, but the qualified name of the\nexception is on the first line.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"d52d28821bc90751b5fb7b6ff0ccc2f77e64bef9","_id":"interrupt@9.0.0-alpha.1","_nodeVersion":"12.11.1","_npmVersion":"6.11.3","dist":{"integrity":"sha512-+elZcdrgcFKP1cF/6tYCDR5+jOv07o1oGBnB05tycSabZ2vZajmcwzvPiWQrZOsLxoLlNaVnldrThOEZRp3tOw==","shasum":"86d175badea8ff80a744fc5aae0b247d2a2bfc32","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-9.0.0-alpha.1.tgz","fileCount":5,"unpackedSize":19165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoTVsCRA9TVsSAnZWagAAzggP/jvUlbjDkmOXD+moWRP4\nWtufgUJbea2SqH53jnmC8xlaE5ck6GwrOXzrihRTEYjneDTVvIsHaRj+GzKn\niTJURuHyVR+rs++eKrQAmAL6nEhv1v9UA38N6oqTuaYElQAfg+1pDxs7lz3W\n32uzkLAsGf8sB8GtBPnyfjrK+pKCdvDyficcecCdYcnzKZClgMH6+ftXW/ui\nTR2DCCV1oei4zHUeydmbDeG95Px1Uu417cZUjIYiH464e1+d44PFa8SUL7K7\n0eXs9lBKv8r0Ew2Zg24vxjaiAuD4WDc/Ud3DvfvUnBjHPTak86QOaSJRz0RC\nPzkYr+FbbX6QxRU4rDiIdsY4pBxQ1EPgXgF7bHn42Jk0gaLl75k8NsQb2Ma/\njfu9FPZ/KYg16uUqI4Z/lfKOg8TzDYmCAqrMdbEFCd0uuHTkfM24b72qiZPk\nq60w5qMVexXSEEefYw858tFXd9IQqjgBjYEENL3kA1IdWf1iu2Jq0SSvn+B2\n9f5DSPxivrwO8aBUtojsmw9zpS3EPE1bggzcGtNFQ3yHOREj0ElZNr1/ADOv\ncNLK1oa6Hdu5xq7Ucoo5InWCdo1gUP/tiZsVtwU20x2+WilLyVWK4wdfq5Ar\nbDZ52P3665X8EixlfWFLNk6ZjZa24iM7Netj7Z2vpl5bZgm1cVTEm+vNqWIH\nc4BW\r\n=oCt3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5CKCyM+ng+4FMIBpLkjUCtkTLFbdwWlv+wy+NsU1QXQIhANLkaBzFAeThuEqYOJZc8MjsejWdmk5KuneY4MlCTCUe"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_9.0.0-alpha.1_1570846060169_0.9950135572534518"},"_hasShrinkwrap":false},"9.0.0-alpha.2":{"name":"interrupt","version":"9.0.0-alpha.2","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15"},"devDependencies":{"proof":"^8.0.0-alpha.7","stacktrace-parser":"0.1.7"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA comparator function builder.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `cadence` which has a nice\nimplementation of asynchronous `try`/`catch`.\n\nInterrupt as an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failures\non the command line and in my server logs. Interrupt supports nested\nexceptions, context for exceptions and complete error reports on fatal error\nexit. It does this using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [additional work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type-based `catch` ladder.\n\nIn order for `Error` to be useful to Node.js we've had to add a non-standard\n`stack` property that we in turn depend upon for meaningful fatal error exits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates an `Error` that is more useful than the `Error` that\ncomes with Node.js. This is fine because the useful bits of `Error` that comes\nwith Node.js are already non-standard and the standard itself is not very\nuseful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement declare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above and work with default Node.js error reporting.\n\nInterrupt may appear to be trivial but it is effective and easier than fiddling\nwith `Error` directly (even with ES6 support for classical inheritance).\n\nIn addition to the report with nested exceptions, the ability to declare\nan error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesthetically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human-readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human-readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/rescue) to catch\nInterrupt-generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches calls the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception message is multi-line, but the qualified name of the\nexception is on the first line.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"1d164a4fa92df30e5d4a9d83474f3d5a934a368d","_id":"interrupt@9.0.0-alpha.2","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-GdaVr9WyayCabvyZJYNljsW3Qxn9z2YVZpF8exgGO7nIA4AIecanYJe6ZMV/TDBrL5MbzpIsQBkqybNb5GBWMw==","shasum":"532a78a236548988575f1c96180d2ad5ef2c3acd","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-9.0.0-alpha.2.tgz","fileCount":5,"unpackedSize":19263,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdq/i8CRA9TVsSAnZWagAAZtIQAJ13/7QT3YnA0qK7/+wJ\nCNwNsMfEKtvJMYPfRkzy0kgvLs15+hdeLkO78WoXhAhEz0gj9Ec5SV4Ftj94\nOgvju5ryFHhoyfdN2tVTLYMdx9bDUolOCZGQx38toc4U8d2NlSo+3OH5pflm\nAr/uLCh7CwzGrMhKUp99zcAYG83iwlUkta39fklX3mpvbx2RcsfKCIjJoodb\n8PoQr75Fe3h/Z8Hc6PSC6p07dirUowTLUBspOcmP8t+YSXu4I0yrqDEHVr8p\n9FQaLz3leUWRj8GLi96L9GJsTrkTrq/JH0rBia8hvQI5A/yg54qB1gGOS8YV\ny//suM1aTqSCyfjvGGtJ1qrg/jWsypx52QCjGmSa50deAwzDLyNzZqI90ALc\nI7ZOMej2eF1sL55/l68BZZ2xf6dyvJVpTffI+AZVg/M6GAyGTccqheR2hf0b\nDEZWxFODuCBnQcpM3atZZbboH8RE0x+cLwKAgbMnjHnYvPdtxRiPIj2Lqw83\n54/nZ0Ctmb5Pj2jWfQBn6fT7XmJw7MBIPnm51kahaKq80aFCc6weUgvSSss6\n8wnf1n4b/2Kp0GrgTDrMxigdi6Q9WcbonKwG4C0QAqeNAuOIOETfEJmto5Nr\nNOzSu4HyEFRAhdxxkGxYPDeILp5WqCUxTnoaZLllQDqNBiKVCrJOYIjOuzAf\n10eL\r\n=+JPS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB53dzmF7TWljcsLzrHkD2zbnTaLd1wjUKdqyUO5q0orAiBT+c8LLPXuubqKpl0TymH79o3z1uQutAyr0vVsvoOQxQ=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_9.0.0-alpha.2_1571551419637_0.5739577809119814"},"_hasShrinkwrap":false},"9.0.0-alpha.3":{"name":"interrupt","version":"9.0.0-alpha.3","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15"},"devDependencies":{"proof":"^8.0.0-alpha.7","stacktrace-parser":"0.1.7"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA comparator function builder.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `cadence` which has a nice\nimplementation of asynchronous `try`/`catch`.\n\nInterrupt as an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failures\non the command line and in my server logs. Interrupt supports nested\nexceptions, context for exceptions and complete error reports on fatal error\nexit. It does this using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [additional work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type-based `catch` ladder.\n\nIn order for `Error` to be useful to Node.js we've had to add a non-standard\n`stack` property that we in turn depend upon for meaningful fatal error exits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates an `Error` that is more useful than the `Error` that\ncomes with Node.js. This is fine because the useful bits of `Error` that comes\nwith Node.js are already non-standard and the standard itself is not very\nuseful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement declare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above and work with default Node.js error reporting.\n\nInterrupt may appear to be trivial but it is effective and easier than fiddling\nwith `Error` directly (even with ES6 support for classical inheritance).\n\nIn addition to the report with nested exceptions, the ability to declare\nan error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesthetically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human-readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human-readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/rescue) to catch\nInterrupt-generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches calls the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception message is multi-line, but the qualified name of the\nexception is on the first line.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"80728634c1dc78b75b7d757f129bdf9053befc75","_id":"interrupt@9.0.0-alpha.3","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-ccEkILJBq5AdIqLe6fyopNhnEVduZwJ+Dr31Tos7J7hD2iEwFseKzSagxI6XbpRBud6yp+/ZI7+9aHchNrSyNQ==","shasum":"a93af89aba8bc2aa632d0e810b14037774ef8a74","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-9.0.0-alpha.3.tgz","fileCount":5,"unpackedSize":19286,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdrbIqCRA9TVsSAnZWagAA72UP/R+yuN3yWqAwxXnhrqF2\nR1b2YVLSgpkzJA3OYuGasmvF080HnIllZub8iGkacPfLBZgcQ2z7WtL6lDu0\nygX1iGIyYjJdaDkBMQuEP7WwhLeljnPuSYAilMiMTIkTg8WgSazL7le+7SV6\nPeBforzAS33xw+wGUz7w3Ey5nk/MEj10IsJ4ddGqxkizA/IXdSS+x2K/nE2j\nGTbwsCExa5UuPslixwlAPb5j7RrhY6oD9KoYydKpRmVmsEQ0T8wuQwrnw1tp\naTvHOBi17H33WWrjfOLakojBrBATFKqyWCgPnQOeRyd04juM8UvI1LCWp/9v\nV4zYrOqLjsHQ+uppK6y5kTfiXo8RXhrGKMXcb7v9P/N6JXIbM5yuguwfR5U1\nopZfJ+c0A62xCgBkeCiVskKBL9+NuZKR6T2QHCRCvYhHo9QLkzRs5jk/RpyQ\ncyCQhphpeHHCs/yOga8RfNop7SaIlHPkHQw5Avhr7LFeZJBtsKjgD0bg4swJ\nXjStmQp25qinLcXRjL3dFFGGdNNyUt+CRVIfwDNXOMOSrmfOTiBaLbdY7/HD\nT02fOP70LWxPBxT1wQ+BaRKWUHkegxwD2KlxQLg0XV0755NkDaEtfniQH4E6\nWdZ8qYOz8U2YCownxb/qgb4qxnkOeaNVDh3SIfkhi6B78A68RaUk1bt2FE33\nN1gr\r\n=l3nz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDosKZoCqLqxDKECNbVENOZFUKaDHsYcjywCxyNnZ5CwAIgDBhnrpKQ/UYfIrcTNVrNB9vqt/JSvOPbI+zlyiSkxnA="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_9.0.0-alpha.3_1571664425469_0.5569147547705835"},"_hasShrinkwrap":false},"9.0.0-alpha.4":{"name":"interrupt","version":"9.0.0-alpha.4","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15"},"devDependencies":{"proof":"^8.0.0-alpha.7","stacktrace-parser":"0.1.7"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA comparator function builder.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `cadence` which has a nice\nimplementation of asynchronous `try`/`catch`.\n\nInterrupt as an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failures\non the command line and in my server logs. Interrupt supports nested\nexceptions, context for exceptions and complete error reports on fatal error\nexit. It does this using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [additional work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type-based `catch` ladder.\n\nIn order for `Error` to be useful to Node.js we've had to add a non-standard\n`stack` property that we in turn depend upon for meaningful fatal error exits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates an `Error` that is more useful than the `Error` that\ncomes with Node.js. This is fine because the useful bits of `Error` that comes\nwith Node.js are already non-standard and the standard itself is not very\nuseful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement declare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above and work with default Node.js error reporting.\n\nInterrupt may appear to be trivial but it is effective and easier than fiddling\nwith `Error` directly (even with ES6 support for classical inheritance).\n\nIn addition to the report with nested exceptions, the ability to declare\nan error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesthetically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human-readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human-readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/rescue) to catch\nInterrupt-generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches calls the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception message is multi-line, but the qualified name of the\nexception is on the first line.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"9ffc12465b4efd5e93de006fba7329e882e29693","_id":"interrupt@9.0.0-alpha.4","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-d+uGIvu2IkYaH+GBQBmFwHzC7sgXE2PqxBZNtmxHJK1K0bhFgl5XHX7sXjPRNqXWfgiu7yt/7hGN9XJYZFGM+w==","shasum":"c5df10a8a64ef23ac86993c27bd1b86346168120","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-9.0.0-alpha.4.tgz","fileCount":5,"unpackedSize":19286,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdrtR/CRA9TVsSAnZWagAAPEsP/iv4TY29WoGqet3UY6hP\nbHGN/vtJFpm0zAlHrfD4qz8W6t4loEtv8BcUY+/6mn8kuiblhkuIwB1EkW5c\n1ypSxaS49T4Y5eGOeulfctPlVsf2ggtsdtcQHiMt0V01+n8neURsrM2Wub1v\nZRdgT3qWggVTAo/XiklBehE5fcIgfyR+yMN3iUS1pssa8Ytf6bQpnn22rK46\nXtHX6YlYd+3VZ2qITaj/5efOYhvK6z19dIVB6gGoo+rzJxVyvzNoD0jgodiS\n0QLk+lTWZxVFqf6QS1Rrbk+hiYpzvVHWmMIDxbSZBxzAZW6zfbTarh2EnLtL\ntvFdQgJW6rzDIJciEDI3Zy5kr4+CNs28x+Y44J28Rk2j8FGd9kZhJwO+kGsx\nV/G9iTMdSj/m4kM9kKaDTGu5qEgYj+DDleSbv7NMMAuQlhDXmzs1N4ohCfaQ\niPVnrlmkZ0HVHZOhNiF0pkRYCLbm4JH2GcuZlXnjUM0qVTuJ4VnvS6RZd6Ke\nUD9eh2Q6ebM6fLvAwtiAK0V2nsGE057IjMmQ7yeFor+n8zrtqURifHkJdiSO\ngkAuqVmKUTGKFSSNwVD7zs2yVuIKj7hIxFtsljU5iunZg2hzRgZJu9aroyHH\neG6nOryubWaFQGc38JdAsghwxQ9sBi2UtdtsC9aKivGbHQ/o9PTzOFoC6whd\nZQjB\r\n=Vsgp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqVPgHrbc17b3NpC6oBoLEaVvD6zd9auwstFcun6l7NQIhAJtmUzeU1aVEjhsWfecHWwDDmqZ60+k1ZF1FfxYz7KfB"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_9.0.0-alpha.4_1571738751228_0.38558913290163055"},"_hasShrinkwrap":false},"9.0.0-alpha.5":{"name":"interrupt","version":"9.0.0-alpha.5","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15"},"devDependencies":{"proof":"8.0.0-alpha.12","stacktrace-parser":"0.1.9"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA comparator function builder.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `cadence` which has a nice\nimplementation of asynchronous `try`/`catch`.\n\nInterrupt as an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failures\non the command line and in my server logs. Interrupt supports nested\nexceptions, context for exceptions and complete error reports on fatal error\nexit. It does this using the `stack` property which is specific to Node.js.\n\nInterrupt does not attempt to create a library that is useful across all\nJavaScript implementations. Why not attempt to make it work across all\nimplementations?\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [additional work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type-based `catch` ladder.\n\nIn order for `Error` to be useful to Node.js we've had to add a non-standard\n`stack` property that we in turn depend upon for meaningful fatal error exits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates an `Error` that is more useful than the `Error` that\ncomes with Node.js. This is fine because the useful bits of `Error` that comes\nwith Node.js are already non-standard and the standard itself is not very\nuseful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement declare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above and work with default Node.js error reporting.\n\nInterrupt may appear to be trivial but it is effective and easier than fiddling\nwith `Error` directly (even with ES6 support for classical inheritance).\n\nIn addition to the report with nested exceptions, the ability to declare\nan error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesthetically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nvar interrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human-readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human-readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/rescue) to catch\nInterrupt-generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches calls the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception message is multi-line, but the qualified name of the\nexception is on the first line.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"9f634c53de82adc20d4de4e9d3e0a796e0b98b32","_id":"interrupt@9.0.0-alpha.5","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-FjFpUmAmWHfy7/1ewImdvVC9DNPiPvxHxtptg33hzannJpjyO9N0Sl5ck/sa/cTFNLUzuSLydKBfpuBVvjXNaw==","shasum":"207692891d683cd20b6f5e5b2e6ff975af3ad03b","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-9.0.0-alpha.5.tgz","fileCount":5,"unpackedSize":19286,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesHrxCRA9TVsSAnZWagAASB4P/iM1oEee6O6w1RWu43Gs\nVXY+EkABjxPVG0zy9bWjHOtQr0qpgOgDTCWDLeWkW7zdAGPeiBaN5SOXm3H4\nYiwsooWF+8uH89YCguvIj9NZ/IHvqz9+nvZCVZNIKlaUtXpUTWCPO+6MjzUQ\nbFSL7GETJRKU0243sLaBVdCTd24z5WqO91FetX4rYOKY3JDrjoQnpXzOW4mR\nR8efjPfiN/kxaEQdesehzn6WM8zySlHZyikYOfzCpqS/rXfh9YWeIM/3HKH6\niCqCaN1Gd14W/J4uHrx9ZiXFkfaK6HmmKFG8JYj5NAZ/otvgM4Fp5Ek98gST\nnldERtxQ8nocq78rMeMtpF+3UnKS/NltmU5QCpvznOAnwynEv8vAzhN3J2Qb\nFUdO81S7HdB2Oorzb1nTtntEWZ8dUSRv2RRw/AyoY8wQZn+XYl8TURZEA8wI\nTx/oQblg1N71kx8qmD2TdFO5n/jBXAxFyrv3FHra9hdGB/VPeBNSUgaFOo5F\nQ/gxt4Z+X8RlJ/lzW7nO3q7BaI0Ht0ZdDwtV8bVXWa/R7G/ZSNLR3gzijHGL\n0mm3M0KMQC+udQK4D/Cvvvd6qSGvFYLEOHO0nRvHOd8jUqrRsQRx7bsJ0r7J\nrHOCsk4e5WrPXmxxeCsBIlDo1uZCtfhD8CzMx6yovJPHjiAchMEYOblcpl4X\nEtrB\r\n=Pr5w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsreuJhoYcExRibjkEvzsvJ4UD01Up115dPEGMJ2V7/wIhAPYLQN2y3HyXqazdy/Ng+wKxHg2ZrcS8xZLrh247eCmL"}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_9.0.0-alpha.5_1588624112766_0.11760597335070822"},"_hasShrinkwrap":false},"10.0.0":{"name":"interrupt","version":"10.0.0","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15"},"devDependencies":{"proof":"8.0.0-alpha.12","stacktrace-parser":"0.1.9"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"gitHead":"cba83a70ebb7ad616daa1dbf9697bb3e89fc308b","_id":"interrupt@10.0.0","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-jdsDEnnybDeVmYc2BP2iA/esgnSQZ2zF3tCwM++7GVsXVCqCuzAyAhDImb4Td1fZ7/E8IAdFe9sDSG/HiigOtg==","shasum":"4898b50df9b4a4c928dc84ecccde39f4cde21c39","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-10.0.0.tgz","fileCount":5,"unpackedSize":19279,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesHzVCRA9TVsSAnZWagAAw+wQAJZ8cjcYlzp5NI/8BCn2\nIm8uyeKlz5zIEib+JzULhgHxLH7Kotd2q64VYeoNY5oGpBs9/yrO4mWeT1FX\nhpCdIDrSvknzqSTHN14Y3kTa6+Vyfdw3Zwezhc47kzydcj4RQzMwX5tXy+/L\nLEM/iGPwrb94voBFflW9Md3ep5pioVzgXGLxLu7ZE3bDtk8BHIKmq67ox+R+\n+82/+OmLiU5NpF8lzvsfu85IiGqW2E7Lt7lveVtV5lJXDjDxww2xvrXYMjU0\nTPvxTZi6gtEMjiKqUsAO8jEpqAqxC4kFiKgEX4KENABjuh30l6/KRSDDsyox\n1ePHPuWShD80c+RloOuuGS2jrUDuxHTZadCRZj/1RqadBIJPxN/t43Pehy5g\ni9N2ehCddC4BcknrQyRSPm63qlO+dCJzihimCPYNzPxMd8oAeySSM2mnzhHr\nwU6kFo/+zuth554zzLVR5Rw0awfc80jAVLLLro31LO/2yrUbt6f68kZLM0v8\nRdsaObaf380cP1lIgSwkKAsi5QYzNQli27UsH1wEXDNG+lTKpPLhmBVKZHIP\nGFqzEdFExsJKE+x+4iUHdQFOpOIR9gUqnU4e9rSpdfuRRZOMPJE80P+jXGs6\nKqSpt0fqi9Pm47PZOhAKF+UTKgxCD0PC3V7eM+Q0ouKuDs4OkB+LPisNvWCe\ntX4w\r\n=V/UT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBCc9SMWI1fWw9X/7pJT811u5JNUabuL09gZPaWnB8SuAiB5c55aNMr1W4V15xmG9aQspMDj5FrPWnrvPJyv3/OLAg=="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_10.0.0_1588624597305_0.7483213714116035"},"_hasShrinkwrap":false},"10.0.1":{"name":"interrupt","version":"10.0.1","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15"},"devDependencies":{"proof":"^9.0.0","stacktrace-parser":"0.1.9"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"gitHead":"e5e6778b2a340a1f3be15fbfe9dee5a303a88aa2","_id":"interrupt@10.0.1","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-Rjys/ltkL4izM9LU1U0e/noGD6um5t/1d4Y+tZ1ay8329rtA1V3MUJiXOR8iyMBohnKlK83n8HVFBEll5lbjAA==","shasum":"8b8cde18879a448a657983dc4518e03cc7ac4334","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-10.0.1.tgz","fileCount":5,"unpackedSize":19271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesH35CRA9TVsSAnZWagAAAewP/RzLqk83sx4V8M+mtoCY\nNYubZGWVBmzMPLC389RhecRF/CIs9bNGTPHGKLL1OYxjt9t5NW3HgGQatY9M\nyvppnbjykD5ThyVrqeUy/7o4X88Gcmb3s4lG3QWDvGg/12Xp6P7IIA6Y7XL+\nXe3Pnm/Kpnuj+dRhPQkxwG6xvRgdwNg0Qb5eHdcHBTOeiqLZzntYRr4k9a0Q\n0wdn8n4H88+cRkvkyaj7NLxw5URli15pTDPcDqRcheXHCvBbcNq8T9O1UNMh\nXpDlEzglCsJx1byhzJuAwYbv8m2E5EcBT/pySCzee+8Z3vxufNL3Qcx6VlW/\nBWEsQ1MCZarLRCEs1nmn8ILdrPQZS1lK7oYY0Oo/kjb9d5eY8werROhasTMu\nhS3zXeLSTIHXgO9BtA/Pd55OvZW8O83C79/yFnLpv+Gj0d9qfEVpvuxv9+HS\nOU7Nuum6ePbePBlEzBcdRv7DiC7SrIhe+oGQ2wnBZQWkO0S53woj/phapghf\nbzd0twydULOK4NxT0CFUE3MJaQ9UOI+EHKf6rLoGvj7uhWH0pnp/WIQrOTau\n5GcNx7t3B2ObFuwEpSLc4SxS94/nl7tqDdgbXSIh7oz+HmQ1GKZdYWSy68be\nciJhuKGdsJAN6RJWTIlEn8+1N4SZh/kZpT+CnYNhVRAQsjSCqJUaBASDMhLE\nijVh\r\n=9JEc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEBWiEyBoSkwt75iCnsneWvsiNy5eh9dlC4xYI+sRSVbAiEA0KKHaKsC6LIG7VTHatmTFR0AmTA2gs6I+fgG6qnOJiQ="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_10.0.1_1588624889155_0.3903602296773019"},"_hasShrinkwrap":false},"10.0.2":{"name":"interrupt","version":"10.0.2","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15"},"devDependencies":{"proof":"^9.0.0","stacktrace-parser":"0.1.9"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"gitHead":"0e3c288477ca9407979a8d2fcea9e3b09bd5582d","_id":"interrupt@10.0.2","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-A7dR+MYZZnkL/LpDCb5TdGaiD2f/sJrPjxS8CXLFmFP/x1TAa6ORF+esO8qtHjvHs/5pfJlwJz8fo0F3KKcdeQ==","shasum":"6b1664e6638f9005b5993a18e69492129627b642","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-10.0.2.tgz","fileCount":5,"unpackedSize":19381,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesxHWCRA9TVsSAnZWagAA3M8QAIrTqx0PBb0aE4QTG1AM\n4TnVarhUqOOEvNIOr77aPs8JnrZlZOk86HhboH8mVIcWl8+4Wje363frZdc9\nLDtxCjd5Aaiia66iYfFbopEzyvovJxGryx5rFswx3ynbEvV1Pc98ytGTv/v9\ntr+2xqHltZ9Y6FGL5t4mxMJqdSqO8p561/w55Q5rsYFkbkMYbrQdM10tLaxm\nvEBH2E669IXgiA+p7lsV6wflc5I/M8oHAfpkG72L/XgMthwYAgurMMIbM9nu\n4NefIWg7bMbpDgfeiQzBtlWAU7IZ5XARPwiCUgn80MG6rWTx75Ik3wzn8zuZ\njXEd2vqJS5tYksj1PdkYBtXzGwHwpQireLPDKappdqZTYEWnv8QqwFxHA9y1\n25fxWf4YFHTO61ZdHrlSWhP81pEc/jp6AIp5V5fJdwgieaXg1h0SNjCB3mZy\nOTqn2UemuvHbOVobw6Ic+qphoBMm4x5ARvJb6OtaubVqEK3pzw7y7y+fqTgv\nE/sC1LIhjTGMhvlvTaMXytovWyt1y5tHcOOxwpZpg8xUSElf0uvGj8cB0YCi\ncf4mN2C9hMnHKiNlazDB2cRosc23VL+0OljAt1ebRFsyNeptPP9Lcu3UyrTl\nYxelFI5mrr000cU19M0LCiA3SoP6hi6mWqQw7oH3EEpFc09d0LuLcwY4p/mw\nVf1B\r\n=icn/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDrCVuuXPIniySD2A3MsCVrSx6n8fr3OrD1IeEj2KRa3AiEAlxipo33rVmhNoqUCZcfoSkyU/Foh000FuStMf0NQ6S8="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_10.0.2_1588793813507_0.3553071967247634"},"_hasShrinkwrap":false},"10.0.3":{"name":"interrupt","version":"10.0.3","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15"},"devDependencies":{"proof":"^9.0.0","stacktrace-parser":"0.1.10"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"gitHead":"d9cdd3b895f9d7d1800e70e650c8555a03e8a6b0","_id":"interrupt@10.0.3","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-cT5IWyGH7+awk2fAItgal6iBkSiqWQohtBTcBWH8VZlS8Iqm0HkST4Y1ycE0oGhF5jMc0DcFrq4w+/57VtglfA==","shasum":"628aef6e16963fed411d492cbf47ced5ba0df4b4","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-10.0.3.tgz","fileCount":5,"unpackedSize":19382,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetAmqCRA9TVsSAnZWagAArRAP/RXnNUu/8ZdTtUTknBLy\nVGViyKE2x+GG6wUVxVcL2sof1BgIMsAeYyfCTGfHEXvC5erIj4PHi1U1RKDB\ndo9iC5tAIQ9AEO9OXExhly8Zdu99vSqqzcSeJQUQz/puOGJ91TVYb3Y4tenS\nOoHPuhjJnrP4Rwef6djfA6GPBBY+5ds2aVcHQafPQ66N98nlExMX4hdRTmYb\niTeBDKW3gTTj4YnWRLf4r+0cxBYwjOx1LbXp8l3xBm+tzwko+YOZc0Md42uz\nEbWlxsKLB23S/gWotimhFEXEJEWgGjKGyc2KIoXII23dLlU7gEkSrsq7m2zZ\n5ohCtkZhbAj/QbmGCa0wuaGyki4QTj/Wb45JUDVXaw8euKcSXo2XeFgyNWoS\nC6MWMdlm8SEwN0igANQ3xtnxeUo2pgP6ws2AsCE8VMVypjAhpw1IaI86tvZ8\nvWj7nJ8DO3DGomSJ7mWdj4Gh/MMwAi7yK571XSJ0e6hxVD7doIVToOCk5FUo\nB9l8DYxwDAQEicZ7UaDBeRnjBXaL1kxE6aRhTZXoJOdIPjSjBndjfWc9EDPY\nvvLXRSkbau2ZigHeoooukMFgftKyw3WXFU1uiKU0WLDZYFuNrXlBW8Zwbdqm\nEvdcNAK9xFNvYXghg6w2P/ZEFpHfs44DzRbPOsttRV47a1PEgdTGQENKbGf3\ni7rI\r\n=+d93\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHFQwf3fyyZqLYGxdUVV2XPQ6Mp5WISFBS56Rcnc9a+LAiEA0Zm7JmFpX4EYJcL8+hPyDVzGhq9Ha/Qr4DA4MrPIDNo="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_10.0.3_1588857257678_0.047725199984565814"},"_hasShrinkwrap":false},"10.1.0":{"name":"interrupt","version":"10.1.0","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15"},"devDependencies":{"proof":"^9.0.0","stacktrace-parser":"0.1.10"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"gitHead":"5152ddeda985f4d9e1d82639116f56c130973c4a","_id":"interrupt@10.1.0","_nodeVersion":"12.18.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-HUKl3H2buccEa9iZrGK+iQHEJ9PEhgrx9gOKl2BBN0s0r2EQh+oVrC2a6iCivIpHzH89fk9goFGnFd9hbSiO6w==","shasum":"135f8840c7f42e0b960a5210d0662b4c3dca959f","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-10.1.0.tgz","fileCount":5,"unpackedSize":19642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2v5gCRA9TVsSAnZWagAA/OIP/jqTvcEIx+tpiCrSx0jx\nQZTGMO7Lj7DztciekZhvt0Z6QMDh13/Vne/RiYgIhl9Clybch6BgKHJDT8c+\ns2DTJkS7tzmm4XdiAejz7LO7n6MLUnRMnknxKk2EkUhahrZHMvwVou2SjT5u\nQ9mE4UR8FBsHP1RD5VobjrsRHu7/y81D/6n/jaFDxLRZSFwq0byPKmEIw2Su\n9bi/Zcdt7Vaf8EeoDBTW36wwt+/f+WZzRNx/Kmxa0N86PN6F/Riyq9fSJazx\nPTG7+UuKXbj8zxQ6C1ruEqpm8roSHAkMTQLaBnTRvC8KhClDKhJCDSN6A0iR\nd0gnW5avxjjLydI1GK++DJ1y7uwRhPYa++XNsCSpIPdJt/2ConGxRmQPOhfv\ndveTWKQYEkMHrbUbb+vBMbt6hQqjaJAqCLjDBYp5OEzZ2BmGUzxe1IWT1AAG\ne43XhKJ0CYA19ZJcQ9K6bdKlHieh6aCS2samFoP12beCj2DCsqJi446GkdDx\nLCCtH6s4CIK4jWcpJRPpHy0H4pjzP6rijoDnpG+gA1b4/rqPnjEowMFhfOX1\ngu8uWLXxv3pm1vQKsNiogSRVtzWrDLH+a/0jgSuyBeocXxdFH2WZNgXsZoGE\nmcOGmzKr9y5PiOZZzVWqsnIsYt06t9hmLA5R+d6B6NEbpoUJoT+YYcFmZtXH\njuU0\r\n=MdcN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzbu+4Lj676NHtU5tTMgc+qFssmPbF0quxgTQaIOhFewIgYskhwninJOW5Q1XxhNC5Omv8LYuqgI8QY+xM4cZyhic="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_10.1.0_1599198382925_0.3857213317603898"},"_hasShrinkwrap":false},"11.0.0-alpha.0":{"name":"interrupt","version":"11.0.0-alpha.0","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15"},"devDependencies":{"keyify":"2.0.5","proof":"^9.0.0","stacktrace-parser":"0.1.10"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA comparator function builder.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `cadence` which has a nice\nimplementation of asynchronous `try`/`catch`.\n\nInterrupt as an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failures\non the command line and in my server logs. Interrupt supports nested\nexceptions, context for exceptions and complete error reports on fatal error\nexit.\n\nIt does this using the `stack` property which is specific to Node.js and\nInterrupt is therefore Node.js specific. If there is interest in using Interrupt\noutside of Node.js, let me know where and I'll have a look at what it would take\nto adapt it to a new JavaScript environment.\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [additional work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type-based `catch` ladder.\n\nIn order for `Error` to be useful to Node.js we've had to add a non-standard\n`stack` property that we in turn depend upon for meaningful fatal error exits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates an `Error` that is more useful than the `Error` that\ncomes with Node.js. This is fine because the useful bits of `Error` that comes\nwith Node.js are already non-standard and the standard itself is not very\nuseful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement declare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above and work with default Node.js error reporting.\n\nInterrupt may appear to be trivial but it is effective and easier than fiddling\nwith `Error` directly (even with ES6 support for classical inheritance).\n\nIn addition to the report with nested exceptions, the ability to declare\nan error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesthetically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nconst Interrupt = reuqire('interrupt')\n\nclass Foo {\n    constructor () {\n    }\n\n    static Error = Interrupt.create('Foo.Error', 'FOO', {\n        'NOT_FOUND': 'cannot get %s, item does not exist',\n        'KEY_NOT_STRING': 'key must be a string'\n    })\n\n    put (key, value) {\n        Foo.Error.assert(typeof key == 'string', 'KEY_NOT_STRING')\n        this._values[key] = value\n    }\n\n    get (key) {\n        Foo.Error.assert(typeof key == 'string', 'KEY_NOT_STRING')\n        const got = this._values[key]\n        if (got == null) {\n            throw new Foo.Error([ 'NOT_FOUND', key ])\n        }\n    }\n}\n\nconst foo = new Foo\n\ntry {\n    foo.put(1, 'a')\n} catch (error) {\n    assert(error.code == 'FOO_KEY_NOT_STRING')\n    console.log(error.stack)\n}\n\nfoo.put('a', 1)\n\ntry {\n    foo.get('b')\n} catch(error) {\n    console.log(error.stack)\n}\n\ninterrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human-readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human-readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/rescue) to catch\nInterrupt-generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches calls the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception message is multi-line, but the qualified name of the\nexception is on the first line.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"6cf1b2175bb7c8fd37a1a63c0efb91a8a0d5c735","_id":"interrupt@11.0.0-alpha.0","_nodeVersion":"12.18.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-vTpY1cBszXVKKZfZ5EeedoN/CoWQ1o7DdvtAUYMfNmiSXM/KixdMm+nUph5dJGQxVdSVU0ZlBamk7CWd0Z2kUA==","shasum":"7cf7cd788222a49411abda62bef044d7f3254e6d","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.0.tgz","fileCount":8,"unpackedSize":35233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjhPdCRA9TVsSAnZWagAAvrIP/2Smd+RVOE49gDXqk6/e\nSnYvmGlsRC5ARTiZrRnlT9SAb7w3wP5iKp+umCO5q0lQ1mfNJfqWHNUQ4GS/\ngLQxSWoB2PNzP2DCxAI1l3ndaTVH5bPsXwVSMbr7Fv9jAkNzGhfQWrymm2Ih\nZpBS2JiuLbArzrMQQJ7bYvIqVzUsNkPwf0g3INg+PSs9OLSfaJ279weKHBpG\n0G5+PJb2xDWL3G5XeszVhsAAVVQwp+fvMJOlQsGbXdPS3wL7eXY1rQvQ4kKa\n6XuvcCVnYKv+p2Ew04lMosynNc3OLm+DG9ajJSqJ6sI5Iv3H4WTQtAvJeDpG\neJoDmL3BV5D2osQGIJ8czC/M17EUS529Fru4/yMHxyP1RShUxDgs/eXErBl9\nj+48ef1Qk/HT3Bn4EsNbhxA9w8tW99oI6kUQ6wBYAmCouoraKRVNefo0TSm8\ntISuAjTHhAf10fQMXO91ZBC0+a0dJ3MKYbuCxbven4t1FZYdndjX7RLDTxEF\niJH0pr/xw66Li+p2DKzWP8JYeD8lj+8jFo5i6FiAN7l+81n2TGI3BiIarlXv\nj3GtuGjVl6O8sFnO5hLIWw84TOx/I9zlFFG5WTBzuyJokAbaZBovFKO2y/Bn\n6FLo7iI+rrbdKwL9z0THO5YS/2PMQm6nirHGxvr3kTVk3G4xLkprzdwa2VRa\nHByE\r\n=TI84\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA4lcGIkdQZ76Trj1DtRQodnhdwdoKRdQt/ah3l6Age9AiEAyIndGZ2+QxGEGeAQPMp/ItRB61K2iZEScOIV1aCult4="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.0_1603146716560_0.04088330427018416"},"_hasShrinkwrap":false},"11.0.0-alpha.1":{"name":"interrupt","version":"11.0.0-alpha.1","description":"Errors that you can catch by type.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5"},"devDependencies":{"proof":"^9.0.0","stacktrace-parser":"0.1.10"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA comparator function builder.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n\n## Why?\n\nExceptions are useful. I like the concept. I've always been able to program\ntry/catch in Node.js regardless of whether a function is synchronous or\nasynchronous because I've always programmed with `cadence` which has a nice\nimplementation of asynchronous `try`/`catch`.\n\nInterrupt as an `Error` generator allows me to gather up errors from many\ndifferent waiting asynchronous calls and report them in a bouquet of failures\non the command line and in my server logs. Interrupt supports nested\nexceptions, context for exceptions and complete error reports on fatal error\nexit.\n\nIt does this using the `stack` property which is specific to Node.js and\nInterrupt is therefore Node.js specific. If there is interest in using Interrupt\noutside of Node.js, let me know where and I'll have a look at what it would take\nto adapt it to a new JavaScript environment.\n\nIn JavaScript, Error defined as some arbitrary object with an `Error` type and a\n`message` property. It is, in itself, not very useful.\n\nThe error type is supposed to be subclassed the way it is in other languages,\nbut for years `Error` would not subclass without [additional work](https://coderwall.com/p/m3-cqw/subclassing-error-in-javascript-is-harder-than-it-seems). Furthermore, it\nwas the only suggested use of subclassing in this prototypical language, so it\nnever did feel quite right. Finally, unlike other languages, you can't catch an\nexception based on type. It was a behavior borrowed from other languages without\nthe key benefit; that you could build type-based `catch` ladder.\n\nIn order for `Error` to be useful to Node.js we've had to add a non-standard\n`stack` property that we in turn depend upon for meaningful fatal error exits.\n\nInterrupt organizes `Error` with custom properties so that you can start to\nprogram with exceptions and use the patterns that are common to other languages.\nIt creates meaningful error reports by stuffing `message` with a plain-text,\nhuman-readable, machine-parsable error report.\n\n## Overview\n\nThis library generates an `Error` that is more useful than the `Error` that\ncomes with Node.js. This is fine because the useful bits of `Error` that comes\nwith Node.js are already non-standard and the standard itself is not very\nuseful at all.\n\nJavaScript's minimal `Error` lacks support for some of the most common concepts\nin exception handling found in other languages. Interrupt re-introduces:\n\n * One or more nested exceptions as causes.\n * Context for each exception in the form of attached properties.\n * Single statement declare and throw exceptions.\n * Plain-text, human-readable and machine-parsable reports that include all of\n the above and work with default Node.js error reporting.\n\nInterrupt may appear to be trivial but it is effective and easier than fiddling\nwith `Error` directly (even with ES6 support for classical inheritance).\n\nIn addition to the report with nested exceptions, the ability to declare\nan error, set context properties and throw it in one statement reduces chatter.\nExceptions are off the happy path and a lot of chatter to setup an exception is\naesthetically unpleasing. Interrupt makes it possible to throw a detailed\nexception with a one liner (or one statementer.)\n\n```javascript\nconst Interrupt = reuqire('interrupt')\n\nclass Foo {\n    constructor () {\n    }\n\n    static Error = Interrupt.create('Foo.Error', 'FOO', {\n        'NOT_FOUND': 'cannot get %s, item does not exist',\n        'KEY_NOT_STRING': 'key must be a string'\n    })\n\n    put (key, value) {\n        Foo.Error.assert(typeof key == 'string', 'KEY_NOT_STRING')\n        this._values[key] = value\n    }\n\n    get (key) {\n        Foo.Error.assert(typeof key == 'string', 'KEY_NOT_STRING')\n        const got = this._values[key]\n        if (got == null) {\n            throw new Foo.Error([ 'NOT_FOUND', key ])\n        }\n    }\n}\n\nconst foo = new Foo\n\ntry {\n    foo.put(1, 'a')\n} catch (error) {\n    assert(error.code == 'FOO_KEY_NOT_STRING')\n    console.log(error.stack)\n}\n\nfoo.put('a', 1)\n\ntry {\n    foo.get('b')\n} catch(error) {\n    console.log(error.stack)\n}\n\ninterrupt = require('.').createInterrupter('module')\n\nvar object = null\ntry {\n    console.log('value is: ', object.value)\n} catch (e) {\n    throw interrupt('value', e, { object: object })\n}\n```\n\nRunning the above generates the following.\n\n```\n# node notes/readme.js\n\n/home/alan/interrupt/notes/readme.js:7\n    throw interrupt('value', e, { object: object })\n    ^\nError: module#value\n\n{ object: null }\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:5:38)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n    at Object.<anonymous> (/home/alan/interrupt/notes/readme.js:7:11)\n    at Module._compile (module.js:635:30)\n    at Object.Module._extensions..js (module.js:646:10)\n    at Module.load (module.js:554:32)\n    at tryModuleLoad (module.js:497:12)\n    at Function.Module._load (module.js:489:3)\n    at Function.Module.runMain (module.js:676:10)\n    at startup (bootstrap_node.js:187:16)\n    at bootstrap_node.js:608:3\n```\n\nAll information is available through `Error.stack` and is more or less human\nreadable.\n\nBecause it is all in the `Error.stack` property, it will be recorded by default\nerror logging implementations. It does not require a special\n`unhandledException` method to get a detailed report. It works well with the\nstandard error logging of Node.js which prints `Error.stack` to the standard\nerror stream.\n\n## Parsing Errors\n\nIn addition to being human-readable the error can be parsed.\n\n```javascript\nvar parser = require('interrupt/parse')\n\nvar interrupt = require('.').createInterrupter('module')\n\ntry {\n    var object = null\n    try {\n        console.log('value is: ', object.value)\n    } catch (e) {\n        throw interrupt('value', e, { object: object })\n    }\n} catch (e) {\n    console.log(parse(e.stack))\n}\n```\n\nThe above generates the following output.\n\n```\n{ type: 'Interrupt',\n  qualifier: 'module',\n  name: 'value',\n  stack:\n   [ { file: '/Users/alan/git/ecma/bluey/interrupt/notes/parse.js',\n       methodName: 'Object.<anonymous>',\n       lineNumber: 10,\n       column: 15 },\n     { file: 'module.js',\n       methodName: 'Module._compile',\n       lineNumber: 635,\n       column: 30 },\n     { file: 'module.js',\n       methodName: 'Object.Module._extensions..js',\n       lineNumber: 646,\n       column: 10 },\n     { file: 'module.js',\n       methodName: 'Module.load',\n       lineNumber: 554,\n       column: 32 },\n     { file: 'module.js',\n       methodName: 'tryModuleLoad',\n       lineNumber: 497,\n       column: 12 },\n     { file: 'module.js',\n       methodName: 'Function.Module._load',\n       lineNumber: 489,\n       column: 3 },\n     { file: 'module.js',\n       methodName: 'Function.Module.runMain',\n       lineNumber: 676,\n       column: 10 },\n     { file: 'bootstrap_node.js',\n       methodName: 'startup',\n       lineNumber: 187,\n       column: 16 },\n     { file: 'bootstrap_node.js',\n       methodName: '<unknown>',\n       lineNumber: 608,\n       column: 3 } ],\n  context: { object: null },\n  causes:\n   [ { type: 'TypeError',\n       message: ' Cannot read property \\'value\\' of null',\n       stack: [Array] } ] }\n```\n\nI don't imagine that it is going to be incredibly useful to be able to parse\nexceptions, but that it is possible asserts that the necessary debugging\ninformation is complete and well structured.\n\nI find that having everything in `Error.stack` makes it hard for most logging\nsystems to lose errors. They might neglect to fire custom error handlers, but\nthey rarely neglect to record `Erorr.stack`. This is nice because you'll usually\nonly ever realize that the your penultimate error handling logic is broken when\nyour program is broken and an important parting message is getting dropped by\nyour logging mechanisms.\n\nWhile I don't imagine that parsing errors will be incredibly useful, it might be\nat some point, if you record enough state in the error context, you could go\nback over your logs extracting errors and parsing them for application specific\nerror properties. I've never found a use for it, but there it is.\n\nThe human-readability and completeness has been incredibly helpful, however.\n\n## Catching By Classification\n\nInterrupt uses the `Error.message` property as report. It is designed to be a\nplain-text, human-readable report that can display in your terminal.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    console.log(e.message)\n}\n```\n\nThe above outputs the following.\n\n```\nmodule#foo\n\n{\n    object: null\n}\n\ncause:\n\n    TypeError: Cannot read property 'value' of null\n        at Object.<anonymous> (/Users/alan/git/ecma/bluey/interrupt/notes/message.js:6:28)\n        at Module._compile (module.js:635:30)\n        at Object.Module._extensions..js (module.js:646:10)\n        at Module.load (module.js:554:32)\n        at tryModuleLoad (module.js:497:12)\n        at Function.Module._load (module.js:489:3)\n        at Function.Module.runMain (module.js:676:10)\n        at startup (bootstrap_node.js:187:16)\n        at bootstrap_node.js:608:3\n\nstack:\n\n```\n\nNote that when you inspect the `message` property of an `Error` it does not\ninclude the file and line where the exception was thrown nor the exception type.\nThat is added by the uncaught exception handler when printing to standard out.\n\nIn most textbook examples of try/catch, the author uses an if/else ladder that\nis probing with `instanceof`. Interrupt adds the properties `qualifier`, `name`\nand `qualified` that you can use in `switch` statement or `if`/`else` ladder.\n\n```javascript\ntry {\n    f()\n} catch (e) {\n    switch (e.qualified) {\n    case: 'bigeasy.example#fs':\n        console.log('I/O error with code: ' + e.cause.code)\n        break\n    case: 'bigeasy.example#http':\n        console.log('HTTPO error with code: ' + e.statusCcode)\n        break\n    default:\n        throw error\n    }\n}\n```\n\n\nI use a library I created [Rescue](https://gihub.com/bigeasy/rescue) to catch\nInterrupt-generated exceptions by their qualified names.\n\n```javascript\nvar rescue = require('rescue')\n\nvar object = null\ntry {\n    try {\n        console.log(object.value)\n    } catch (e) {\n        throw inerrupt('foo', e, { object: object })\n    }\n} catch (e) {\n    rescue(/^module#foo$/m, function (e) {\n        console.log('unable to write object: ', e.object)\n    })(e)\n}\n```\n\nIn the above, the `rescue` function returns a function that tests an exception's\nmessage against the regular expression and if it matches calls the given catcher\nfunction. The `m` switch will cause `$` to match the end of a line, not the end\nof string. The exception message is multi-line, but the qualified name of the\nexception is on the first line.\n\nThis is what I like to do for now, but I'll probably move to `switch` statements\nnow that I've finalized Interrupt.\n\n## State of the Argument\n\nTwo different thoughts on the state of subclassed `Error` for exceptions in\nJavaScript, the\n[pro](https://medium.com/@xjamundx/custom-javascript-errors-in-es6-aa891b173f87)\nand [con](http://gunargessner.com/subclassing-exception/).\n","readmeFilename":"README.md","gitHead":"5742313bcf51c77435f88af657b1870196a4d886","_id":"interrupt@11.0.0-alpha.1","_nodeVersion":"12.18.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-DeYvVxe2CKU2AysaZDB9DJtxhz5sPJV92zKvjk5KKvLnqpRGcuttsfUsad5SONQXzoGR9E4v2G4AHlFQriifkw==","shasum":"518b8eff0f9351a879c6458fa8e6c5ea4194b2c0","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.1.tgz","fileCount":8,"unpackedSize":35233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjir2CRA9TVsSAnZWagAAYuMP/jSlmF7pNc8Bzqy5I4xR\n7ucBd4LsRCU9IWkWfvWJC5q6yje9SBMi2WdOdXmgOwpyFRANVc6puwpNy7nR\nbguiVqX996GKif22Sn5xJVnhx80qb8LZdfLwhcjWdoo8fzI5Q1PDIWhGFhbY\nQvBmzwnu5iX8t9JlIPwGWXy27twAjk98cMXBZDl6r/bB4/jkenkebV4WQndH\nE58rObsbF9JPgIlctElAeAB8plxxhIC87Y01qk5EIzWyaV3MOClgFf6Bm5LG\nFSu6fxUp7e3lnFIg44w2oqBoXq2X2Dl7bVfpFyEWoYJIKcbKiNgTZa2E3WOJ\nz0QZdwvXkc4bNmFdvbXEYtFh1Y91p/eWHtxmNdvxSq8qABZubol5K4HqLkhg\nDrIYtCKyaYvgD8CJLy1d0bSK0XJBFYBhDqawAFt/IeiPNNCvDiZzPbgtfScw\nMnUfnR8FS22oKZiDlgE+ACcieGqBzkKUaXWQizPH5zCv4N5I2mDt6oMWElHw\nArKWaEC7lmqQ9LhS4QUdZHd8xUt3lnfkUhcZ4wyBe/j+tEhh1RAdpQmhbFhx\nQpnWs3OUvGbueSSuWB2S3j5cY+mMUOsjIU2VdOVOs/XI/tKohrObQcxFX9e9\nh11QbZL28995kiYncwKVZQGEKBNkO52wBH18BSnLzR0Nc7sDO0Ubn2yQJZVv\n2Jjh\r\n=SWmb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDQzJuSr8nITGVJutamDBLXZQjPu+LQ7YexYp+vqCRgKAiEAn/wkIHk0VjDyuM1BiBc80aZhuJDdRZ/qKV72jYWMx00="}]},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.1_1603152630006_0.3468618036583422"},"_hasShrinkwrap":false},"11.0.0-alpha.2":{"name":"interrupt","version":"11.0.0-alpha.2","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2"},"devDependencies":{"proof":"^9.0.0","stacktrace-parser":"0.1.10"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"f9f0a2cddb1d096ca4d94f1e1191a16c86eec61f","_id":"interrupt@11.0.0-alpha.2","_nodeVersion":"12.19.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-OVBVvNQ4AoGLn7QEzM2f+sZjo5HXPHofGKziV+XKEC8GXHjAQb1DpQ/+hs/fpM24HVGxATq+h0eaeOO5vi8KDA==","shasum":"d2909db1903b3b6cdcf9f877df4b39b44554ffa5","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.2.tgz","fileCount":7,"unpackedSize":136080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0JIWCRA9TVsSAnZWagAAb7gP/1EKVA3fMWpsf3sr4Ngm\ndDhiw5DW04kBfKBDZ+gZmA9I/eGwTCFHam1BJ/tLz2WMdaNk3Wmc8XqV8BuQ\nUOUgll7yR7BmWBbJbkv1IJGtNKVb5SCI6oazni3lnWw1/nasZOXMgC5OVyBH\nvp33XYaj/lHBMaA4gXl/3koV5WN5+Pbn6dNLlqN6RvLXSOEq4HEOnIg/L/eI\nox/cA2laH09HdARxvb3+vn2Z8rMSMUTn8CDjVDvwQai9OMMpRuyjbnHq4ccG\nMZJ9/i3nt59thGpRK0sfcsmTc3DmyGK/X39nQf/W5ZGqJwUuAg5nkrk0BoGS\n3+qWbIANhE6IiknTOsgM78PKLwkBsCfNkmnK9e3XfLAP4GZQ34/zgHoE9dE5\nly/v7At++7X0Ykl2OVW6AlcWpUWZSQyXV+7V9ZqfQqOSosgiif6Ox5KKi2l4\nGTTF81q8pFXoYXm/C+fdSogyhWt63FKTBvA7klp8wzanEu+b95Oz5EozkQy2\nN+/gwEPe6wswoG2Ne0lNsTp5F+mgwH8uDbAbq7/qm3V6opqEm5/OmmTodixx\ngNvCHrUvLRGrcori0C6KWQMjzbe1fBkov6IJchhZqdNxPeDVhRQoL7PuDgwA\njGzqc45P42I4wAiJ+qw+bRHSrSGZPSacWU2cZYXLiWi3Grc7aSrmEIlscuXx\noG2c\r\n=So1J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDV77caXxkmJ9JkEn5fcMx+hY+71MOc+2C0+edwe1QIBAIhAOOMkAeCdv9NbX9xZEK2W49wCx3g2BgEnbho9ZcOR1UR"}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.2_1607504405876_0.08520219778110527"},"_hasShrinkwrap":false},"11.0.0-alpha.3":{"name":"interrupt","version":"11.0.0-alpha.3","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"b6f09e5773ca885b5f49e6ee22ed683c6f0428c1","_id":"interrupt@11.0.0-alpha.3","_nodeVersion":"12.19.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-30hzevP+zeHhYdX7NukJaWkSgx6s/ZZ2tacg37rakBin6zxQ9nCGo2ua2WNbi8Ucx22tq737nEBTTl6INie+ew==","shasum":"1139e01f00073cbd3f53174b4eb800af4b2ed9d0","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.3.tgz","fileCount":6,"unpackedSize":80777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0Jg2CRA9TVsSAnZWagAAqXUP/1aneuTl2Qx+drbN1lWk\n+7y6dV/w9T/btWF5RUlbkezn/pxONSxhdsv/QYUP25qvEVGXj3LxP72q5I3O\nlvXlxW34Nv3nauLFlV6Ua7x7yNIfdpz8h+XpcXlIIeqg6JIqAHSapcgLaJ8V\nrSHIdzEPlZsepnH+zECpT/gFh6q0n51YO2KuY2b0Q2LbMuTNEi9cxiO3GRJe\noSW5tolLdZihF2tCU4nqMDaa8qDjJhbcp5GQEk0nf48Vd9IpNqw4vsQv1xqx\nEExB4fPyBW9wrp0bly7bePA4+nmFRMlr/P3PXzlqhrFcQY/ePkXUTD/knIqa\nKUOWE22633KFGkyoukkuwoUf0N8co3vYtn9h5p8O4kIRJkOyqw/8o/MsEeJq\nC42XzRfLCSkd2fYaKqj7RZ8PgSWcfh4IetJMEZD35fkma0bSYOaqH37plloh\ntwW4IF1+Xkcx5Ya9ZdecfB/8JdH9kP3e9CrhD0wIxWqL+SRxgNoRzXDASyxZ\nvPB/I1iMZUmE0O4AGTgT/dP+6JDNT/SKDK2gnocYJ+lRRm9Cu9HS9pWARUCC\nlGPkjZTsJESWQodGEFpsK2fjmU0/rcf+xnIyUqQPGzuHPTqFdhRJtzFg8TYy\nKjBoMJpcDBy2FuIYc1jryTOvcMIJv66BSxpSjQWjoueJbZFBehhsbLahwwns\nY7RT\r\n=XQI8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDS9wy8MYaL78knCQhj1AQ7ayCqSH76Mh1OYJx05MDJBAIhAOTcLgkclts+DD6ZUAZEyf4RRqluMDOtSWyaFe2R2NZx"}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.3_1607505974202_0.960765768976573"},"_hasShrinkwrap":false},"11.0.0-alpha.4":{"name":"interrupt","version":"11.0.0-alpha.4","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"50897f19cb1f5de1d9e3cf9782bfe616457d050b","_id":"interrupt@11.0.0-alpha.4","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-3xaqLD8nbEsdKoMkzdihV183Lp8jInfYSnIPKG9Ow15NzocwvLQ1zXnjTlS0BpLObbxSXjzcU+BmlnYkbNTIcA==","shasum":"9ce93c1c22ea8d74fdacd9e321ffb868665322a5","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.4.tgz","fileCount":6,"unpackedSize":80777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf00y3CRA9TVsSAnZWagAAzE8QAIGW5vrOxYPTH6syhNvH\n0ZswnHr6TEXOUwlFVXQchLyIS5+e9oHztTyPk+CtgR6l0e+XZyX6TDzp7vF9\nUmVM9/32k8W5q+nObmSVSngoQS8x9rDzYat6ASXxShYkUZA1DYC+NG1Y0vj8\nv10MBLxTQU5GZn0IpHnRGNi6zCe2S/KSN6SNgvWMM1CtjkCoGq6pW0ALOKj3\neZVzeyx1y2W88DMNm9AixaESAT+q7ueh0tV5DdfYcXkNMRcSaxmQExqR+Fll\naRbrNQQMbvlRYLtrtXpptNxVRtyS1AYKQlLuE/NOkr4MfM6dumVfjDrYQI6H\nL6g3SOHNXchuE9GRgbyk/5jUh/u5kiWYMM1wstZ+na2FB/aedmNeehR/BpEh\nG2eNYcBDsXuVcJSUxxalI0KhLvyJCSvGY1RRxsigYmuIB3I3mxd3oawzkQfa\ndLlHqOIYXdgT7EFZkP4vVWZ9UMsMlqpYUSHz0bwN7iYwdnxpiO3pr9eGLu0A\nDXPHu2vxsMV8GoDO9TuBq9toM2VST0th6t6l2tbMCCNngexVB7QkKk9JlLLl\njR1B0dztpwfa4fu5hfE5LynbxyDFxlBsF1noTObEKuizHgqO7xwtbdS5xxtq\nRpHHcoNkmNgACqqmYLzwwg1e7ZTSSX43h8yR2+q7HvMCa0JuHljTrzdsE4Dw\ntP73\r\n=PD5b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDM3u/7s4TtuR0e4KuoOlwNbtoM7dpkj6wpaAcEK7W9lAIgRnMMJ2wZy4YVvPkILJgVLaCPgxyeb0Ei3KUEODePlWY="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.4_1607683255502_0.03051812533439624"},"_hasShrinkwrap":false},"11.0.0-alpha.5":{"name":"interrupt","version":"11.0.0-alpha.5","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"58d8427b1f656b874a5e54c54338417a6069a7ab","_id":"interrupt@11.0.0-alpha.5","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-dDLz3BcVCFaZBijNF0RY1z+Xd0GH1JNgL6r0kTRsaeojTSWdvckR5VuJHA4duDg5wSBWnYCco4JiBDx0qxEmkQ==","shasum":"35dbc42838b3ef3f1c5a0e388336be6fbd41ef87","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.5.tgz","fileCount":6,"unpackedSize":80777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf002KCRA9TVsSAnZWagAAt6QQAKB0mYpbrol6bEzHcDrK\nKXqgWZppl6sajq2IyztVv8C79Boaqx1DHn0ddC9uUkuUQVlNf82sA2ywuHQn\ncaL+qZ9O7f5Gomzr5R0zXORSKyI8BL5UblLtoRhH5LsK7m+9mPt6//8jEva/\n/qR0P2In1XcpmcMalOiy/KoE3yafW1744mLK0ya2NSqPEDolcqdwRA+lwPCM\nUlHYPX5Ctr4kJwinky3k7OcLY3+hzCgdYMnGd7koDUtI2uKxTlT30SG9Q9hu\nl9QlTNKzSKkA77f9soXO5phYWqqbr47OzTBgi6DFGuF9Sr7p1H9PMqnjQ2E5\nw5nV8NmD6yWtzbQ+qSugGrqhuBkxE61kPnnDTfsocBZIRyIWKk+roHybKN2W\nwl9zkZk0x9XDcuRigeFI6IPvkwPEKlkWiVukdD1U+G9Zq5QENLMJRPuEiNN9\nXcYjqNQd5iqvAtBpdkGHXmDVvYVR+FpoTRVYclxsaWLO/ojpJoNn+7GvsMMG\nBo283hPfYXYBWMXl/T+2zTZHfDyy3vKUHbrr5wsS6eqV+k/4+H+thXCG515v\npCyjJbDyQhS5eLy1aSxCOj6msNbA9P9xLy91xOKxpAtZaUWM6A20P7A+YS8I\nlneFCLer3iuJSeYL2HWZKiGFgyUUzRELOv4Zk1oc/ry1HNFu5RTRR4D+LWOS\nqI8q\r\n=2/M5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/d0IDkDxixZD3LJ4RROkUglkx5EHc12dFDoabfJ4SrQIgZ0kWjXNc5FhSSfK5z6LCZ+/ybi1K/0Zh56JOFqMvMEU="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.5_1607683466534_0.8219283104407666"},"_hasShrinkwrap":false},"11.0.0-alpha.6":{"name":"interrupt","version":"11.0.0-alpha.6","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"737c801ad883b7fc2b72474a85c8ef0a1b15f87d","_id":"interrupt@11.0.0-alpha.6","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-igNNUW7ZY462QuKdh+7P8Owl3aPO5Js62OumdAb2/fTP0fqV++JukuPraDUGKr1axMBVegVB0olBqQAQ2E1f2g==","shasum":"056b2465e1d19bebc0fabfcb909f0230888d6f06","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.6.tgz","fileCount":6,"unpackedSize":83605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1LiyCRA9TVsSAnZWagAA4rUP/iqa76opeeiJ41i9w0EU\neHa4OviM6tcBnXYr0+bT3nb7eb0ttgwGrCWtk0a1A4kIUC7ZtNrwVguqjBy/\no7nDYAB68imAt5atDuZwNXjE7+6JqJU+sIDVrQLZKO3tMqpkpI8kPMXx3dIh\n5htyxPjnYqe5CrFsyt/pqOCrq8CrA73ar3gj7Qf/k9P9y27PHPD8pmfN/v0Z\nxGBvHFtYD4j52ru6udENO6mX34mpMNTT3UM52G6HUCywFkKf0K3KjTvvp/xP\nXzQFArtgPrFJR5h7T1LTVoAttO+55YcO/hHYYIN6lehygKXuutfM8oGwf6IX\nLu8DbhKqOtLxMwI2gj1ACR0S1lRRgm6IPV9vshrJpYRZZ/d+t8Sg2+zyY76z\nDvV00UvxcqzUbxdhr04igrert3V2OnSODabsLs1zPD8LDDG5nlYDVhh9hDEx\nArTFUHZnJsjMgYbJyISUZp/GqgpKDHRv6v3nRAZeZXt6VmZleElGhVra/G4X\ng8FOUxjFS2XWGCrF79h8fPrvMW2HfRFo2IK2e/Eau+45zzTkzdDHaZFnPRzY\nIgaKsMHGgUgpQjhy0vkUNWKkJuQFqOr3n4e9Uokmye/Y8kpzP+6OX01OTf3h\ntuaUcI+H5tJE7b3uJkC7nDCI1knmy1HlqScOnrgixpUKcZc11b01+3BWpszN\nI/Dv\r\n=xDpV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6MhVCvmOmNbSlFBps6JnXqhYjR2fzW16LkOjZntT9TwIgEIpDEkTiCUidYom3rMGs3c+2zt7P9kFi+Fkn4f5kdHU="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.6_1607776433518_0.8370839995117434"},"_hasShrinkwrap":false},"11.0.0-alpha.7":{"name":"interrupt","version":"11.0.0-alpha.7","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"15f575bec167752b16ae1d8066d35c9a61da4f82","_id":"interrupt@11.0.0-alpha.7","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-g72jyoj4tG0UGTojFZrR3frLjWkQAE5A74ATAO37ETeSBiGvduSrswIZznV0GIwuxyphsEob22z0oimuzJkurA==","shasum":"48856b1dd275ea12ebacbfba74d00de3ee80139d","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.7.tgz","fileCount":6,"unpackedSize":82935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1V5zCRA9TVsSAnZWagAARxkQAIWsZIRdlf+Wc001WMv5\n0HgfFhjlJyitaY3yNx8JT3Eb5FYNPxxso6sfpqcofDzHKKXPmCK5YiaQwbtN\n7jnksgIgg41AN/G7YE/oBnlhkEBpGROVWSPqU0FZoiKlhqL3U2aKP4RnQV0M\nUrHt8qWjm67naw1nPvmZdql7uIQShfjoRIStbL7l9LaiHiJlH5Kg3wdvVCK3\nCrA3KuhjjwTNsETytqEZ/jmH253NDmcFh4z1UvH0IjGAS6rGA/tN0g1Pqs3B\nukG+JFMmTyLwsa0lsEhVTZJYW6ub3EK83SyCS9kQwWibuBGzsQPmtZhES2rG\nZcgN19sIg6hpqQomJ/jZX5GWZIhf3bMNNlKdGZQzsWMm/jWo+u83fU6Yk6H4\niBLscx3AyDNPmsVpbVN5GnmC3ZVEIEzul5/cGMo9rPvnY/1gud8BapT3WJLx\ncTVpoL9lxRMqKHhaMN3cpEstmBxhaXlISORAq3vuSGOiaTgU8Lqr97HJhwiU\necK/wK8+mOC/mwbLyh7aKpNmKKr8axChE8I8/v8QlEsuevCkPVo8xhWhx+C2\nq0J13CiNsGovhdJw1wqlskvR0O/C2yrvr8GSqOn2simH2nbuo24YK445mpH3\ndDcwYu0NiUCNtRi+nSFRdF77PqFw1t3Gs6Hpo89AlISrV9KIXb/B+V8X7jhk\nRlxl\r\n=gV1M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHtiZvr7vRFWtUrDiC3Y83m/H8HpFC1X9xe7OlB2jtB0AiAkuRMtkVgC4hKQ4VwmwcNye/po7i8B8uytMauB8ebgHA=="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.7_1607818867098_0.27232383528585435"},"_hasShrinkwrap":false},"11.0.0-alpha.8":{"name":"interrupt","version":"11.0.0-alpha.8","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"7422a5a9143d94035e3f1e3fde8b6895dfe0fa1a","_id":"interrupt@11.0.0-alpha.8","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-UNnbt9NXTaLzbb2on+GLzTMF/jlJzeWnzNnJdizG16XlVyirAnnSTR+KmQzeeW1bYFQ2JkykHdP8MCIYTkKq9w==","shasum":"4be3b4f077c681ce744c53d79c2411386f3f8f24","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.8.tgz","fileCount":6,"unpackedSize":82914,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1e70CRA9TVsSAnZWagAACaUP/2yUwRvtgnaouJF8kNaD\nB+OUq+OtcJy08kJl1f1CvxJUsWaCFk0+zfZbDuGU6jgxHvnyMGy1irof0DOL\nJLdFRIUADyw+R0aVsLxPQLPoM+Q4BoAySezmJYskE1qHcCd6E2+G2Uy/wihn\n9623mMMcI3w6WuZaqZhzi0BsYgveNU6XuzanD2G+eoaf+Q2V6nGaTGKCrsgd\nGPOya7pdHk1aoz6XkSt6nssyaP4otFL5IrytsYdCw1FfPl+00ovSCCjAmxCc\n4jYBIhH6TlpP6MYnuXfjAkE7wkSYO4vlrIdowscgUNk31QHqlfW2iMENxeIb\nigHvue64pZaZTFpghiA6Y7p3xJd0oQ06b5S5zE/TUVdNKiH4ZwS/Zj8TdoSi\nmluwX6tCTMI36GBOpodLorb5C3NDQlyY2kpLpTP0LV/6G088xxUN6r/Y5c7l\ny8ZkasNFMF/iIexut+s5YUuUfmIvQxJoBWtzNATdEW6lLQ4iAxsI1C10MEkR\niuwjx4jDO2dgzxwUAgbRZKsYqBhBdN2Blt+Fj99CRjdSxgdy36ne0D9MriNm\nEv4Mdae2N2lsv4MNnxC2MTZh+yrTqMWDWOiB+kn4DA4nFtgvLMvhDW4jS4e+\nvUL6u2iT37UbWlfl3AP+c60bHnelthsrp50nkZygHhrreJ5vDFR63Un5nVMw\nv+bY\r\n=7/Q/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8dL8vDy4eTDcwMYRdAX+cIrLZHMsD/4ipXjVYP9ZbWwIgOSUk/AWa8CGjndyzq5g0pvF8ym6zyJef1wEgLZ8wxhs="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.8_1607855860011_0.8784065268796801"},"_hasShrinkwrap":false},"11.0.0-alpha.9":{"name":"interrupt","version":"11.0.0-alpha.9","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"260a7132e65716124d06ebfd4321a817abb9cc4c","_id":"interrupt@11.0.0-alpha.9","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-wnkfYCRYPl7GZg/o6pFuEVBqt/B5/z1EvGj/s9a3MohZb/Phq3AcqxeuvY3KKVb0yK9DF6D3YZFiofHx9iLslw==","shasum":"552f7b9f2027945b76f6826fb2fcc6151088aee2","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.9.tgz","fileCount":6,"unpackedSize":82914,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1e/bCRA9TVsSAnZWagAA7EEP/RgoDRqgeJczWSGIfjY7\nOM1VtQ4WJf54Ua0J3hwRLSef+YNbvK04pJj1Rg2JGViQ47U5MBssYbI3TpPK\ngfEtrk+Bf0FM7CxBLZWxUNtBD+NWMNz+nJ0qNeDAeqhA02gZcfkdb74xSlYp\nyhRccn1QNKLzCbYWAheioKmHy9BEzyTSUeQqcv8QUfF552a4hVXSeKLrn+Ap\nDPfv1agu2U/D2HzD4byTRDnvrorO4x04YJnRN7MxPiUgZbMY3Jsb89/8+3l5\nRHWl965nJf4/If7KXVjBwCfY9BKmRK61wjSXmjSMomm9lYwVxFd5Eo888uxA\nQwAkNLTl9WppAa/BqHh43AM7rE97tk8rYRv5B4NoAhySFuA9yJksgpA8lsLe\nC4dWPPVjo1Y7n3m6YQoCl6ZE5NrOJp6T1B86k17qOo4fRySsUFBZkce/SYzV\nB0Zowmeg/ZgG43LrJuYbXNJq+92YeSbzFn+POtOu9fgHQtI9SUf3lmWadyO/\n0aYKrOpRTGtLdbP4r6j9fELGIRomjr9mlqPKZZU3X9nEPKx01uf26xOE+fuJ\n57oLIARKjHclda0yKhYz/q6KkfjURBq8BAVJqb3KAObQhorHvXE9MFvwUnjx\n1DCl/1X9qeqKytaLTTmOplN1sWErtjhj3c8ff6aaQlKeXcUC/iq9C1Bko/RH\nJADi\r\n=cvyn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDShIyrClK0E2L9tTumffGJwVLUhRLmU6bc4TC3D9Y8zAiEAoLXZwbdQqc2aSwLbXR+/gBmyUNxadz4p0+tn9AwKlpA="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.9_1607856091282_0.9078898229736423"},"_hasShrinkwrap":false},"11.0.0-alpha.10":{"name":"interrupt","version":"11.0.0-alpha.10","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"72f86dc0e93e5a84250adfe4bb08f98aff6706b8","_id":"interrupt@11.0.0-alpha.10","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-aFruvkkvx54Cmxe6Vk9WpXwtMQkcPVewiftuCM6bBJkYBnPAA//whkIbvic+b1IHBPt3KqzCnUOb318pIAzrAA==","shasum":"43f3e0fe6816c8949edf4d5ff557f1c050d5d58a","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.10.tgz","fileCount":6,"unpackedSize":83645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1l5VCRA9TVsSAnZWagAAMwgP/A+rPjwKwkVpG+1PwIxw\nOkLxXF6Utt+W9ZLChxL2/ajSUTRtXWqZI6YQq43yLrWDk/8pOPhrDp0oxwej\nF1ZvursCklQb2d/3KP8yG02bfs/Z3wqOGXjo2jQakmXEqKfuqg4V2FM2Ly6B\nnGySKRC7J78BQ9PItMz9kV4ZLcG1g6gLTq0NjwYb/3hJYZ6pwZvVuhbShnvg\nJX7eMvMo7wdfSot/A32foEXZ6RgQVGrSQwPKn8n2BXvxYDPoMo+72Lf8QuzT\nWWerF3sl/CYObezI3XhKTxQ1/53drJ0OgyPTyzfiPgqLwZja0pkcn4ve45so\nVqKVXLYr8hx0AsgGgf6KWPj7w7MdLGGItl6BGCnDSz0Q24eMV/ycGtBlw0oO\nhQLFprRwEGOL8lgDXnDBCpspY0BASwooz0MqnHUFc4eTTYbRULpKkZNfwEg/\n5qYPlMnC4U5Ra7C0bJXqvMuVNkV1ht0fGcT+nFUl2e/2bb/QI51A5iiHcJP/\ndxZIlHyaVKQX5BIviN2vsYTTpshOB3hM0TWU0IqR/xYL29xD/FKh0nLbBwgv\nq+Zx+HquOZvrYqjU9OMhaHPbxwEjY3EdTIAi8ViJ9ZuygmnmPyqjBs8BGXfK\nAe3T/+DyYVIsp/E8lPf4oIE1p44F4JQ5j8LGOszpY/b367z1KimRmdwkVUAS\nzMoj\r\n=nOit\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJRCJtRpXlfnsw7SMcxkeIS6F5jYYhpR2K/d0mpJKAAgIhAOYdQrvQ1XKrOzh5vqvxAXLkt6TPtI8MWKCmER9VAMyT"}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.10_1607884372835_0.22737220024881144"},"_hasShrinkwrap":false},"11.0.0-alpha.11":{"name":"interrupt","version":"11.0.0-alpha.11","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"3aae9278622baa9e152713c5487a816b796908d2","_id":"interrupt@11.0.0-alpha.11","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-SPrdiccyoFotpDBJrs5PfBWFdtWo/3bGGvMhEaeicYADLFOFPolYAOsMPOEguoGqYIjDAttHyk2EGPvd3YEZHw==","shasum":"f536c13008d8b4b473b54908ae6a6decb4b0b891","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.11.tgz","fileCount":7,"unpackedSize":88885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf16YQCRA9TVsSAnZWagAAMg4P/3fIDSRivz5zpYU3TwL5\nWj7yFYRxqk2Dy2Wb31ekWFy2sasobU64Rcdp0uT0oUXbyeGF5bojDyER2zKd\ncsb2qEDmFFFy0+a9bse5cCXdYvdaC+R0CxtkTo9RJe0OR+N2vu67mmJAiAtE\nlUoT0KSAr09/2RhaoNs0Zp3/nR2XAvuNpPgJTJRgXb1MF993bjljKh2EHHpR\nUD1v8lwZVPYxA4llI6ZDVL3m+ujVkxuHbSfKHkljQxuWMWHzG8aXn1WmwgQP\ncYkdF+AiEn16WGwyyxIYkblwp9KNeCeyzOpvxEvf8tYhaM/N/fDMZtFrXo10\ncZzpcRcIcyX8KPsupfROXM6B++3d/WlToiA6XpLORDA/C5vTORrCbiYU8JQe\naaf73Pmb4XjHpVLH1yAFM5QLeFpw7eMLmz7Zx8FE3bRfF+OZG1oyRSzWBf0a\n8nhJcNWlEmKLPQipjED9NVcXLKKrhSGqz2za/cn8fuJaSAkvRiiEvMsl9nvn\nn/5MUS2dN06OM/ILoIUBuzW8qYqGHdcZKNsNHgLrLl4phUhpxZoQ7ID0Fiin\ns1TdXrUQDcs8b2SW+sGmRyAodS1+3V1hJveC623S7IbH1XgiyYffMWVBL/IH\nd2polKhuUv98k+z1JYAxWQr5SYHg6DBRMgh8wOR++7KD1QpJ01BgpPJbP3d+\nz+4w\r\n=sgvV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3dvrOQ1Y+xzKhzPMKbSemUpziXEb3XLNWBu+8TD0gvAIhAL2cMxMGpEHS6cb26GoS8zFpc5XN7RGreB6r0hdpof0C"}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.11_1607968271801_0.008551442249472574"},"_hasShrinkwrap":false},"11.0.0-alpha.12":{"name":"interrupt","version":"11.0.0-alpha.12","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^2.0.2"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"4d452fccb86437115e746b06bd166a6dd5b2c200","_id":"interrupt@11.0.0-alpha.12","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-7UMc33+ckgCQRV09aN5g1v+FUS8tvtZ5lPFAy27Pvg1nEctdiEp5x6h9AX76GqrljPhdJ8KZNGNQIjW/7RNaiA==","shasum":"b7cc331ec322e03920dafe1c143a72212640d80e","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.12.tgz","fileCount":6,"unpackedSize":88437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5BzpCRA9TVsSAnZWagAAU+8P/RsvD0RbVMpuWEsyxcmV\nrZPDLirsmoW9r5px6AcOWcbKtRV36IXtO4JZyIln96nD+2RQj3j7wkUOqBLL\ndHB2Tx1i6hrPQE78tC1vL4JDYyzmRqTYercR+09yjCJU4Lay3MzpNvuXpLC4\nnEbQxcXGL01/mhAHYlpU8Bt3oLLgoudXq35h1beqDBqnKby10S+7Ivez/mgl\ncfS5m4Ri41IlRNWUfqmJQUinhHRYoShu0agTPaKjGWi35NphW/NsuprhXbMA\nLoC+lbnAhUHK3eoXhdznj7EqoS7d/EXjndJlEtFFnaJPSJfb2VVFRaTo78y/\n0tr3vCOChe0nX0L+fgYKKpaP63czeG+B5slERwaiLSS0MfUIji2QrtiHRRqT\npofWa7RubR63CV4jmgG4hE3bRWtXF/ytMkykMsI2Wy9Z26m2dN2RRIkFaeVA\nVrlUfnU2W8NPicK3zYq5HWFoeGvSzTpU3UA6snD/iMH1/PXUke20MwF3cn6Z\n1cU2LwnBLHmIAqCmpOhPKFt2yLSc/bZlo47obK394VFVdmipCjV52DHXFTzH\n7wKxXkWePlNXlZFNFXjCG4sfddHeG17ZGWiYfIEup3YRvOJLu6PDL+ZZFAhB\nCfu5ubC/1J1yhfsrR8gfI9Ah8dWWUkknQkEiV8+yx4l2Osr9A3SxiV9S3G+N\n+iqm\r\n=Qola\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv2HMElwMI/zyx9lFPoLZbOVMRx7wgqdvrCsKowF7TtAIgboooFjxTyQkNNJ9MDeskfVWaE5083tRPEmeV+xrwb8Q="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.12_1608785128757_0.4335922571407951"},"_hasShrinkwrap":false},"11.0.0-alpha.13":{"name":"interrupt","version":"11.0.0-alpha.13","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^2.0.2"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"fbfbd606d31c85ea58843eb6ee4553ce8abdb95f","_id":"interrupt@11.0.0-alpha.13","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-1egAqRE7eEbDJJop0zbFlG5x1pZf9P4cufcJssRUxHJjHlkGmqx5Xim4hZf6TrIXsTohuUESeatU10qUZbNJpA==","shasum":"6a195fcc3f3db43d2d301d9401dea031a108cea0","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.13.tgz","fileCount":6,"unpackedSize":88437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5B2ECRA9TVsSAnZWagAAoAEP/irxg8CyTqOvEn+1wnlc\nX7G6Ngo7la+PzZFf1qX4hYCviunwrppuIU+WeRK/W9uIWV+JSP20L4jut6Gs\n6se0jNUEyyogvecj0ofOxw4gaVn3Uz8R594KR8mqqJn8nrjXTo1PaP9/82xb\n6D/CQkXuU7vEkWqR1U59fqxjmfXgmZnG7+goyHWAamBJIk9Xgvwal+2TwF7p\nJ4EOzCxrulpX6OToT0lzcU757+oQfSgJjQrha8tuuoXEk++/Saa98MV2AeGR\nCS1sz5UkN9nEzqFlub64JIxrfud8k/nrC2GuoIymZuU8EWQdktJHTid5TASL\n1Yjwbt8Oq/Jzw1dLeqEU8f3iIzvdVy5J/9S4QbnTtt78jGeTLvw6Rx5PBnSA\nQezT0SHCM1uCXd6KF4gWXyRk/zRD5puEM5iUFMEg3E7JixnhkFE+nPb2OFJF\nR9Lx/8YTWH0UlpP3YOVQ4+ZTYnGRo7vv1UPstNRJwbLCZb7DxlaQRKq7EYrk\nObPsTZTJprbhSCU0KQZOjM4GOe2tQ8KGDou+PIqbHHbdRPx42rlTq+TkY7TA\nm07710XAMA/as2sRrpG267kIfYwNNFFLEZpJrAowf8tj4m5fgmZEs2fBFQzH\nMAe717wMcod+VjGHPpck4tk81yedfz7yXYPZpWnYjPFMCm95cULHw9B620BS\ngoKB\r\n=PP+b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0ikk4LlCJ6J9+LELzhaSCYOX802qz3hZhPA08rWobUAiEAzy36VhXxNQXt7LAKKpyB+x6bx/HwxkOsL70o0Kb0X7M="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.13_1608785283640_0.841375264175267"},"_hasShrinkwrap":false},"11.0.0-alpha.14":{"name":"interrupt","version":"11.0.0-alpha.14","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^2.0.2"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"1b05848812d6d971d2cdfa65333b3ac7bce1cee1","_id":"interrupt@11.0.0-alpha.14","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-X9w9mjIYGhc2p5tEkB82jR1jjzRQCQXsYnhVteJR65fXLD8pLQ9b1sG5o0QrVAqhufgFhz39Y0KJOs1LYn5g/w==","shasum":"068f699a667b8f914da3809a2bdf464489d8206a","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.14.tgz","fileCount":6,"unpackedSize":88675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5UzjCRA9TVsSAnZWagAAzvwQAIO1D6xx8TN1tE/Qlv5d\n4v5GxVmsa73+8U25nPnmILQW+lxv/C5Vb9/5GbyysvbFNbE1LKCVqGRl2fpX\nc23gpmR22XDInosHxrB7UWpj0X0n5uw69KZ2PYH+t1eg4MNueer9NlH113ub\nF3TevZIgMhMyHdYQos5BChFl+2cPMtcYo7bN05+HtcbskUIyjZxxIrRzA2rd\neWlGWINg0PQ3SqMUm2mOZ57sl4U1ZmmUKptEm4K/CabYGUuBVlM6/lQcO2Qb\nn/N61nWl0AE0uCmadbOTarsa8AUY7LXtL9rbpNIe8y4d5SCSNpubWjUc2Mzd\nO85EP1L0NWQc8F2Ut7s30Tjzo6+IzEtLjIJOSuOzAMx99GXvdJ2VlyqmfcAn\nsUicboOoisEeG4pl461UJ2Rs7kkeGKFSzaVXL0A5xPs1eUISfC+bLzLyDm0I\nizOTptzsgN5vsLqAQqJuKfNFzO3w9towaJpNIFV2ETiM538qDl1j3XHnXjZU\n7lGHlcOVoJbFOgGGUpJ/EYrwPboDekw+shc/0QUSROa+R5699gCDNm70WSHM\nlgevgfwLgk2PO31q+mZLMxRGgenUuZ/iJ4fKKeI87jIXFqx0UPCN4KyXvXHi\nfs5guKaFaG+8eNVU2Nl716U/lgaCK1+Az09zEOBYYibtUMw/OXo5g2hIxwvd\nckG5\r\n=/Y8m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwzMbMhCD4SbtaGz4Lzt61mkBxooMOq2C2DKadWTe61QIgc9KykyxfZ6K9LGh+dhMrzU8vp+gICfA+JNdDLOCiE8A="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.14_1608862947495_0.580852288387603"},"_hasShrinkwrap":false},"11.0.0-alpha.15":{"name":"interrupt","version":"11.0.0-alpha.15","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^2.0.2"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"2915889efd39f1b1923900b814f13978db26c536","_id":"interrupt@11.0.0-alpha.15","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-oGkcaAFgFA81cuJFFZlfUJ2fKfYvqs4scvLRRwDUQVwv3G2OjRjD4tBPNUuWscn2EtZB7eKRaPwB+DIYVMBdeQ==","shasum":"84f9b3d124f6d3909aed124e808e865de2640d5c","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.15.tgz","fileCount":6,"unpackedSize":88717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8AE1CRA9TVsSAnZWagAA2zcP/0XZkxh+ADhTtvHi+XKU\n82EYy6UiF+l1u7T+6ScNrnGaa6nJOiym7q48X06kmgN0UvLJNTuSvRORQoMr\nbRIM4M/lLvWQtmpI3guAQwu8eW016tYYzQgyJOLrwoKJdX9Jk9zFnwhvUhmg\n88W5fTKcMTu30ANkiYfO36KW2d4yh8AwTT7fOFFE0GR7U/n1SG1IZydw+ErL\nHcMo4+XpHGJ/y5PhQWodkbdKYbeZqtWKBCeapnCyVTes0YK7N51yNlKRZiom\nc2e2J+M/66iDlElSVZ44oHDsJAABrUfOyCTOK0Uv8phfmpqox716GAZyd50f\n6pMvc9/9X9dH83B4mbOip0iNBBI9YGaiLCOP58g+K0hRn9IFd3aDgFQgTJ0K\nupQulix9uciVpjaq2qonLl4nZz/vOI2rx7m4S0QJcs4xx7hiTOLRPeCwQqp2\nY1opiTqqFuEfG3IFuez0LOx4i0CqWNe/QOh6MCUVKATm+vycYzvZKqywd1uW\nnaPo6/5u1T6q43C+3FceO5BdKvFNWvk5Esss7z2sP2GRqSQI7yPMXCnIKSDC\nc4j1g8Nk3nmMrtKSrV2QPmzvR9r4ew9jPD8tmPLt2FIUyWHM9Gi0ygyD0nbG\nOhVCMkVJfjZE2lnpWAsDK8UvNtUtOR6IQ3NNbsFt8j74IhhdWqh6hfA8aYVi\n6C5U\r\n=SJCv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDq7w8ISr/m0VnT2+Pz3RtUE7jAHmpGmIydS6zKeuljbgIgcqKXAwefNu+FvNyH4uHEAoIiKCLEFGJGbslSBv3+wD8="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.15_1609564469011_0.48708997334138804"},"_hasShrinkwrap":false},"11.0.0-alpha.16":{"name":"interrupt","version":"11.0.0-alpha.16","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"^2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^2.0.2"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\n\n```\nnpm install interrupt\n```\n","readmeFilename":"README.md","gitHead":"8ddac01c265e510c143aeb218df34abde725f4d7","_id":"interrupt@11.0.0-alpha.16","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-4LJDCuts0SGa5fWV5nljQt/FFIeiO1fy4DGaWQsBE8KoGHFb2o5QmVKfBkG3Yi40SnErmcY3TWSxPVhtwp/jUA==","shasum":"b5112c2e0e5a8ec653663eafba83be78cdd4c9cc","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.16.tgz","fileCount":6,"unpackedSize":88718,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8AHFCRA9TVsSAnZWagAAvfYP/iMZWlQWT4TUB3KjFRoa\no2Qa6njEw3rW9X8/9W+WZ8CkxlBtuLa2nuRTR8DQokVsu+mDZgpKHTmO7RV8\nDR3WK9LB7ymSSL6IfHmsyiNPOja/cae21qtx9xi8RZJJ274Dn3nb59PRIdjy\n6RIQE2PNt7JltQyqIuCfnkXSLx3v6xAN9UfEZIqhLyO47rDIaDtySi+b3trU\nJeK7rbMsLtwEQAPISqKsoxgoiLKhQkxzf7YD3IdGCz2aBokruLcGjHtw6xeh\npvyUVATB66CceJMifBDJRrosZ7ztnyZ2YhGlu6SJc8rH5pvQdsIV7lyFQQDx\neaIKx3uOkqPTTPguYh1UihY9DSZ49N1c13lM27KHpy1bV/jZP3aEIGeddVNO\nsYI7B2IgRj6xuDV/S3FPUcvKEoSZkQ0uUp1fm5SznPUyK14ApSRDxuCxOshZ\nDZ5LOeyKigUbuHGtytUCCZivWWALPaqtzfBWt0DqMZWtlX6bcoH4nQCNsvv6\nZxceUSCxR0tkmJ44Sue9PvTEz1krlPm45mfKfbpw/Lajhs02AGwrTJe02ncV\nnxsIhJ+HtSA8myJ4SkLYGrJHlhGZUS7OIXcEz5fsnirvazh4Sm001nhfg3en\nFoTtKE27XDkmR8iAqYu9ZyF7twAamK38aWVGRGXvZ+Akn/oa8F9UIopO+wpt\n809F\r\n=YU+R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD746UJBsIk5s47ITOTAYw4HwJaEPEpF/OFgVfodHvDdAIgOwFZqRmRJbQIKlwLib9PGkSpUabXQmkKS+pkTBl110k="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.16_1609564612580_0.13110709859426328"},"_hasShrinkwrap":false},"11.0.0-alpha.17":{"name":"interrupt","version":"11.0.0-alpha.17","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^1.0.15","keyify":"^2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^2.0.2"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\nInterrupt installs from NPM.\n\n```\nnpm install interrupt\n```\n\nExceptions are nice. I like the concept. I've always done my best to employ them\nin JavaScript and Node.js but it isn't always easy.\n\nInterrupt is a module I created to address the problems with JavaScript's\nlimited exception mechanism, solving the challenges I've encountered over the\nyears that I'm sure you've encountered as well. It is not an elegant solution,\nbut it is a solution none the less.\n\n## Advocacy\n\nInterrupt allows you to get exceptions that have a file name and line number\nfrom your program, instead of a stubby stack trace that points to the wilderness\nof the Node.js source, or [no stack trace at\nall](https://github.com/nodejs/node/issues/30944). It does this with some\nsyntactical struggle, but without the expensive superfluous stack trace\ngeneration of the long stack trace modules.\n\nInterrupt allows you to nest exceptions so you can provide application context\nto system and library exceptions.\n\nInterrupt allows you to cite multiple nested exceptions as the cause of your\ncontextual exception which is necessary if you're doing any sort of parallel\nasynchronous programming where multiple parallel paths can raise exceptions.\n\nInterrupt uses and abuses the `Error.stack` property provided by Google V8 to\ngenerate an elaborate report from `Error.stack` including the `Error` type,\nmessage, context properties, and stack trace along with the error messages and\nstack traces of all the nested errors.\n\nInterrupt's elaborate `Error.stack` is machine readable so you could conceivably\nprocess these stack traces programmatically after gathering them from production\nlogs.\n\nInterrupt can report it's elaborate stack trace de-duped with a count of similar\nexceptions so that when great many parallel operations raise the same you don't\nhave wade through the repetitive stack traces to see if there is anything unique\nabout one of them.\n\nInterrupt endeavours to do all this with a minimum of extra code and code paths\nso you can format exception messages with `sprintf-js`, set properties, specify\nnested expressions the constructor, often as a one-liner. **TODO** Basically\nadvocating one-liners, poorly worded.\n\nThis `README.md` is also a unit test using the\n[Proof](https://github.com/bigeasy/proof) unit test framework. We'll use the\nProof `okay` function to assert out statements in the readme. A Proof unit test\ngenerally looks like this.\n\n```javascript\nrequire('proof')(4, async okay => {\n    okay('always okay')\n    okay(true, 'okay if true')\n    okay(1, 1, 'okay if equal')\n    okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')\n})\n```\n\nYou can run this unit test yourself. The `--async-stack-traces` flag is not\nnecessary on Node.js 14 or above.\n\n```text\ngit clone git@github.com:bigeasy/interrupt.git\ncd interrupt\nnpm install --no-package-lock --no-save\nnode --async-stack-traces test/readme.t.js\n```\n\nThe only way to see the elaborate stack trace output is to run this test at the\ncommand line, so please do so. **TODO** No, we're going to fix that.\n\nInterrupt is targeted for Node.js 12 or greater. Note that we are running with\n`--async-stack-traces` enabled and to enjoy all the features discussed in this\nreadme you need to be running Node.js 14.\n\nThe Interrupt module exports a single `Interrupt` object.\n\n```javascript\nconst Interrupt = require('avenue')\n```\n\nAll of the examples in this code are _contrived_, and in practice, I'm\nnever quite this zealous with my use of exceptions or Interrupt.\n\n## Happy Path vs Error Path\n\nThroughout we'll be referring to the happy path and the error path.\n\nThe happy path is the path of code execution where everything goes as\nexpected. It is the code path that gets the most exercise, the path that\nreceives the most robust testing.\n\nThe error path is the path of code excution that is followed when things\ngo sideways. One would hope that the error path is not often executed\nduring normal operation. One would expect the error path to be followed\nas a result unforseen circumstances that might not have been considered\nduring development. Sadly, the error path usually does not receive a lot\nof testing. One should tread lightly on the error path.\n\nInterrupt endevours to be exacting on the happy path and accommodating on\nerror path. It has a lot of assertions on functions that are executed\nduring normal operation and a lot of fallbacks on the functions that are\nexecuted during exception handling.\n\nWhen we speak of the error path in this documenation, we are urging\ncaution and justifing our accommodations. When we speak of the happy path\nin this documentation we are urging rigor and justifying our assertions.\n\n## Errors by Code\n\nErrors in JavaScript have very little context information. The only\nproperties defined by the spec are `name` and `message`.\n\n**TODO** As of this writing, Interrupt is targeted for Node.js and Google\nV8 only, but can probably be ported to other JavaScript engines if\nsomeone would like to recommend a cross-browser development setup. I'm\nopen to porting if someone is interested.\n\nThe `message` is supposed to be human readable and because of this it\ndoesn't serve well as a programmatic indication of error type.\n\n```javascript\nconsole.log('\\n--- message only Errors ---\\n')\n\nconst path = require('path')\nconst fs = require('fs').promises\n\nasync function loadJSONConfiguration (filename) {\n    let json\n    try {\n        json = await fs.readFile(filename, '')\n    } catch (error) {\n        const e = new Error('file unreadable: ' + filename)\n        e.cause = error\n        throw e\n    }\n    let config\n    try {\n        config = JSON.parse(json)\n    } catch (error) {\n        const e = new Error('unable to parse configuration')\n        e.cause = error\n        throw e\n    }\n    if (config == null || typeof config != 'object' || Array.isArray(object)) {\n        throw new Error('JSON must be an object')\n    }\n    if (config.size == null) {\n        throw new Error('memory is a require configuration parameter')\n    }\n    if (config.size == null) {\n        throw new Error('memory configuration parameter must be a number')\n    }\n    return config\n}\n\nlet config\ntry {\n    config = await loadJSONConfiguration(path.join(__dirname, 'missing.txt'))\n} catch (error) {\n    console.log(`${error.stack}\\n`)\n    // If the file doesn't exist, use a default configuration, otherwise\n    // rethrow any configuration exceptions.\n    if (/file unreadable/.test(error.message) && error.cause.code == 'ENOENT') {\n        config = { size: 5 }\n    } else {\n        throw error\n    }\n}\n\nokay(config, { size: 5 }, 'used a default configuration (example)')\n```\n\nOther languages have the ability to catch an exception by type. This\nability to catch by type is where the idea for an exception class for\neach type of error comes from.\n\nJavaScript does not have this ability. Once the exception is caught it\nmust be filtered through an `if`/`else` ladder with `instanceof` to\ndetermine the type of exception. Using entire classes for what is\nessentially a flag is a heavyweight approach. The user now has to import\nthe module's exceptions into the namespace of their application to use\nthem as test conditions. Not only do we have to add this `if`/`else`\nladder, we have to our `require` statements start to look like this.\n\n```javascript\nconst { ConfigParseError, ConfigIOError, loadJSONConfiguration } = require('./config')\n```\n\nThis is so foreign to JavaScript, to use type information directly,\ninstead of using ploymorphism. Kinda feels like we're moving the\ninternals of a dependency into our module to check a flag.\n\nNode.js itself doesn't extend the error class heirarchy by much.  In\nfact, in our code we further test the cause of the I/O error by checking\na `code` property to see if it is a `ENOENT`, the POSIX code for a\nmissing file.\n\nThe Node.js libraries use a base `Error` class (with the exception of the\n`assert` module) and simply set a `code` on the error object. All of the\nerrors eminating from the standard Node.js modules have a `code` property\nand each `code` property has associated documentation.\n\nIf you use codes your module can adhere to this practice.\n\nInterrupt prefers to use codes as well. Interrupt encourages you to\ncreate a set of error codes for your module.\n\nYou can still create an Error object heirarchy using Interrupt, but once\nyou have a set of codes you start to see how they're easier to work with.\n\nYou declare your codes when you create your Interrupt derived class. You\ncan obtain a list of declared codes using the static `codes` property.\n\nIn the example below we declare a `ConfigError` class with an object\nthat maps the error codes to an error message. We can get a list of the\ncodes defined using the `codes` property of the generated class.\n\n```javascript\nokay(Interrupt.prototype instanceof Error, '`Interrupt` is an `Error`')\n\nconst ConfigError = Interrupt.create('ConfigError', {\n    IO_ERROR: 'unable to read config file',\n    PARSE_ERROR: 'unable to parse config file'\n})\n\nconst codes = ConfigError.codes\nokay(codes.sort(), [ 'IO_ERROR', 'PARSE_ERROR' ], 'set of generated error codes')\n\nokay(typeof ConfigError.IO_ERROR, 'symbol', 'constant that maps an error code name to a symbol')\nokay(typeof ConfigError.PARSE_ERROR, 'symbol', 'one for each error code')\n\nokay(ConfigError.prototype instanceof Interrupt, 'generated error is an `Interrupt`')\nokay(ConfigError.prototype instanceof Error, 'generated error is therefore also an `Error`')\n```\n","readmeFilename":"README.md","gitHead":"cf8067750f9abe7fc82b86cb78b0343678efbcfb","_id":"interrupt@11.0.0-alpha.17","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-+o7awKQo+Z2rzYlyCv25CJKwm/Eh/fql/uF4yqaSWrgnMZnlaCdvl4I5YK1elYVg/JgoSXdRZH17x2hIc2SAhw==","shasum":"9dc6881623d097e5ac8d894ff66d9278beae0fcc","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.17.tgz","fileCount":6,"unpackedSize":98161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDrVhCRA9TVsSAnZWagAA9iAQAJ/IAt0u6TksE9k2yXaG\n6q8NgOjBcuGau5ydruwvd4ZjKJWNxCbhGSiv4luFgHT8tu7qVsgD0EojJ7Pk\nGPdTQjmNrK+G+TLaA0MPREZLXqQY1sAP5/t54Oyr1b3yX1a2vjhdVTi0AAyA\nTahI0cEjmS0WugFIzsBk4xJGubo+kCs23YhCNaL86Y53Yh07+NQ3hixR2aMP\nEqZtIi+GQgcrfgbvN3T+ZmDA8OW+I53JYgQTSH9Wy1lL3Jh3lon389jWxGFN\n2dc0/le+kbksOwqYnRrp1yF3WcWRUSNyc+sUIdAEFplcF9/O4rvi+IlZLwkF\nbekjAcBUvBZR+zjIagZtVlG+PeaiMRRzffIpSH0XbYnxYphRf16cNI8Nlink\nHT2mY65BpWbY3hNFILgL2igC9tNSgh42uYng3epm+3Cvr+Vi0AFdR1Ly02Tl\nsJ8zx0LfjIfmu1ucQiKmxgaQuEWw1PrxH1FWrees9rOfu4LAPU5Yndej+9cB\nG5cz81nS/Wk/xpaOqma9BsVNd3pK1xr52p2BJ/FqMxPT8MgvUGIKN8zr8RZh\nSLbKrV1tGdrbsunHRvWoMss+G/saGQoiAbm8lTC6+C397L/Nwqt/0q/9o51o\nR3sTFXByL7cgIGxvfuhISQbJ40m3gAOX1TKgvoizcFlc/f8XiT5Y7wM/Srg1\nF5P0\r\n=+jR/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQrpuiNoSHOmUwDWHyZ/dmJ2dT7+jilHPTH2ZGRLh5eAiEApye1CS67M0jz8dgK9o4axcB10nMGQxs2Ed7ZjHw+Cjs="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.17_1611576673073_0.8671680908180572"},"_hasShrinkwrap":false},"11.0.0-alpha.18":{"name":"interrupt","version":"11.0.0-alpha.18","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^2.0.0-alpha.0","keyify":"^2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^2.0.2"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\nInterrupt installs from NPM.\n\n```\nnpm install interrupt\n```\n\nExceptions are nice. I like the concept. I've always done my best to employ them\nin JavaScript and Node.js but it isn't always easy.\n\nInterrupt is a module I created to address the problems with JavaScript's\nlimited exception mechanism, solving the challenges I've encountered over the\nyears that I'm sure you've encountered as well. It is not an elegant solution,\nbut it is a solution none the less.\n\n## Advocacy\n\nInterrupt allows you to get exceptions that have a file name and line number\nfrom your program, instead of a stubby stack trace that points to the wilderness\nof the Node.js source, or [no stack trace at\nall](https://github.com/nodejs/node/issues/30944). It does this with some\nsyntactical struggle, but without the expensive superfluous stack trace\ngeneration of the long stack trace modules.\n\nInterrupt allows you to nest exceptions so you can provide application context\nto system and library exceptions.\n\nInterrupt allows you to cite multiple nested exceptions as the cause of your\ncontextual exception which is necessary if you're doing any sort of parallel\nasynchronous programming where multiple parallel paths can raise exceptions.\n\nInterrupt uses and abuses the `Error.stack` property provided by Google V8 to\ngenerate an elaborate report from `Error.stack` including the `Error` type,\nmessage, context properties, and stack trace along with the error messages and\nstack traces of all the nested errors.\n\nInterrupt's elaborate `Error.stack` is machine readable so you could conceivably\nprocess these stack traces programmatically after gathering them from production\nlogs.\n\nInterrupt can report it's elaborate stack trace de-duped with a count of similar\nexceptions so that when great many parallel operations raise the same you don't\nhave wade through the repetitive stack traces to see if there is anything unique\nabout one of them.\n\nInterrupt endeavours to do all this with a minimum of extra code and code paths\nso you can format exception messages with `sprintf-js`, set properties, specify\nnested expressions the constructor, often as a one-liner. **TODO** Basically\nadvocating one-liners, poorly worded.\n\nThis `README.md` is also a unit test using the\n[Proof](https://github.com/bigeasy/proof) unit test framework. We'll use the\nProof `okay` function to assert out statements in the readme. A Proof unit test\ngenerally looks like this.\n\n```javascript\nrequire('proof')(4, async okay => {\n    okay('always okay')\n    okay(true, 'okay if true')\n    okay(1, 1, 'okay if equal')\n    okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')\n})\n```\n\nYou can run this unit test yourself. The `--async-stack-traces` flag is not\nnecessary on Node.js 14 or above.\n\n```text\ngit clone git@github.com:bigeasy/interrupt.git\ncd interrupt\nnpm install --no-package-lock --no-save\nnode --async-stack-traces test/readme.t.js\n```\n\nThe only way to see the elaborate stack trace output is to run this test at the\ncommand line, so please do so. **TODO** No, we're going to fix that.\n\nInterrupt is targeted for Node.js 12 or greater. Note that we are running with\n`--async-stack-traces` enabled and to enjoy all the features discussed in this\nreadme you need to be running Node.js 14.\n\nThe Interrupt module exports a single `Interrupt` object.\n\n```javascript\nconst { Interrupt } = require('interrupt')\n```\n\nAll of the examples in this code are _contrived_, and in practice, I'm\nnever quite this zealous with my use of exceptions or Interrupt.\n\n## Happy Path vs Error Path\n\nThroughout we'll be referring to the happy path and the error path.\n\nThe happy path is the path of code execution where everything goes as\nexpected. It is the code path that gets the most exercise, the path that\nreceives the most robust testing.\n\nThe error path is the path of code excution that is followed when things\ngo sideways. One would hope that the error path is not often executed\nduring normal operation. One would expect the error path to be followed\nas a result unforseen circumstances that might not have been considered\nduring development. Sadly, the error path usually does not receive a lot\nof testing. One should tread lightly on the error path.\n\nInterrupt endevours to be exacting on the happy path and accommodating on\nerror path. It has a lot of assertions on functions that are executed\nduring normal operation and a lot of fallbacks on the functions that are\nexecuted during exception handling.\n\nWhen we speak of the error path in this documenation, we are urging\ncaution and justifing our accommodations. When we speak of the happy path\nin this documentation we are urging rigor and justifying our assertions.\n\n## Errors by Code\n\nErrors in JavaScript have very little context information. The only\nproperties defined by the spec are `name` and `message`.\n\n**TODO** As of this writing, Interrupt is targeted for Node.js and Google\nV8 only, but can probably be ported to other JavaScript engines if\nsomeone would like to recommend a cross-browser development setup. I'm\nopen to porting if someone is interested.\n\nThe `message` is supposed to be human readable and because of this it\ndoesn't serve well as a programmatic indication of error type.\n\n```javascript\nconsole.log('\\n--- message only Errors ---\\n')\n\nconst path = require('path')\nconst fs = require('fs').promises\n\nasync function loadJSONConfiguration (filename) {\n    let json\n    try {\n        json = await fs.readFile(filename, '')\n    } catch (error) {\n        const e = new Error('file unreadable: ' + filename)\n        e.cause = error\n        throw e\n    }\n    let config\n    try {\n        config = JSON.parse(json)\n    } catch (error) {\n        const e = new Error('unable to parse configuration')\n        e.cause = error\n        throw e\n    }\n    if (config == null || typeof config != 'object' || Array.isArray(object)) {\n        throw new Error('JSON must be an object')\n    }\n    if (config.size == null) {\n        throw new Error('memory is a require configuration parameter')\n    }\n    if (config.size == null) {\n        throw new Error('memory configuration parameter must be a number')\n    }\n    return config\n}\n\nlet config\ntry {\n    config = await loadJSONConfiguration(path.join(__dirname, 'missing.txt'))\n} catch (error) {\n    console.log(`${error.stack}\\n`)\n    // If the file doesn't exist, use a default configuration, otherwise\n    // rethrow any configuration exceptions.\n    if (/file unreadable/.test(error.message) && error.cause.code == 'ENOENT') {\n        config = { size: 5 }\n    } else {\n        throw error\n    }\n}\n\nokay(config, { size: 5 }, 'used a default configuration (example)')\n```\n\nOther languages have the ability to catch an exception by type. This\nability to catch by type is where the idea for an exception class for\neach type of error comes from.\n\nJavaScript does not have this ability. Once the exception is caught it\nmust be filtered through an `if`/`else` ladder with `instanceof` to\ndetermine the type of exception. Using entire classes for what is\nessentially a flag is a heavyweight approach. The user now has to import\nthe module's exceptions into the namespace of their application to use\nthem as test conditions. Not only do we have to add this `if`/`else`\nladder, we have to our `require` statements start to look like this.\n\n```javascript\nconst { ConfigParseError, ConfigIOError, loadJSONConfiguration } = require('./config')\n```\n\nThis is so foreign to JavaScript, to use type information directly,\ninstead of using ploymorphism. Kinda feels like we're moving the\ninternals of a dependency into our module to check a flag.\n\nNode.js itself doesn't extend the error class heirarchy by much.  In\nfact, in our code we further test the cause of the I/O error by checking\na `code` property to see if it is a `ENOENT`, the POSIX code for a\nmissing file.\n\nThe Node.js libraries use a base `Error` class (with the exception of the\n`assert` module) and simply set a `code` on the error object. All of the\nerrors eminating from the standard Node.js modules have a `code` property\nand each `code` property has associated documentation.\n\nIf you use codes your module can adhere to this practice.\n\nInterrupt prefers to use codes as well. Interrupt encourages you to\ncreate a set of error codes for your module.\n\nYou can still create an Error object heirarchy using Interrupt, but once\nyou have a set of codes you start to see how they're easier to work with.\n\nYou declare your codes when you create your Interrupt derived class. You\ncan obtain a list of declared codes using the static `codes` property.\n\nIn the example below we declare a `ConfigError` class with an object\nthat maps the error codes to an error message. We can get a list of the\ncodes defined using the `codes` property of the generated class.\n\n```javascript\nokay(Interrupt.prototype instanceof Error, '`Interrupt` is an `Error`')\n\nconst ConfigError = Interrupt.create('ConfigError', {\n    IO_ERROR: 'unable to read config file',\n    PARSE_ERROR: 'unable to parse config file'\n})\n\nconst codes = ConfigError.codes\nokay(codes.sort(), [ 'IO_ERROR', 'PARSE_ERROR' ], 'set of generated error codes')\n\nokay(typeof ConfigError.IO_ERROR, 'symbol', 'constant that maps an error code name to a symbol')\nokay(typeof ConfigError.PARSE_ERROR, 'symbol', 'one for each error code')\n\nokay(ConfigError.prototype instanceof Interrupt, 'generated error is an `Interrupt`')\nokay(ConfigError.prototype instanceof Error, 'generated error is therefore also an `Error`')\n```\n","readmeFilename":"README.md","gitHead":"511d4ee2dca2aa82c6bcbc89b6c991c6282d8d87","_id":"interrupt@11.0.0-alpha.18","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-tQsrxdd4QDr5RP0tOtGmMa/9vN61Y66MihA2kiXzFR2h2o5Agn6tX13tUcE8/lgVramxFWWfp7R2CSfroEywTw==","shasum":"023f6163d13321b14f2ab2b0188ed3a49380a2ba","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.18.tgz","fileCount":6,"unpackedSize":98182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFaoWCRA9TVsSAnZWagAAf1AQAJQ4P6kcXsvWlzTqzW7n\nGy6kb49XKnzZwg+aeI/60xLl3xSpQp+dK3/osoY59Tc2In8fAo0LIi5LDkSG\nVTuI/AVMiqnEe554adFeifDDitFt6AC1hthG0rYtYEX3jqoBnXNEJylC0/45\nqMMqd7fjYSepY3UzBDYnpVZh75QStvHX5/FSX9GmULOG1HGh3acNZXdcuUrH\ndC4QtNp8ZenhyE34eTpSWhLh3EFzI3M5+g4UHgz34/5XU8zSIj5mteIQs78f\nf6Uj6xtWACf8wEB8UFVX6QprMXe8j85egIC1qpdMZyfgxPxGt00Tjluhh+uR\nhxn56pCopbb/cKYNcbvTFP9+J6+p2ug0kKDdl7YR2o0TIjdxXbimKgteLdQ1\nrAP2W9CKchsA/T2dl/Nm0HmGpYOvwx4nvUDfWXFyA1RR8BhDKFKwbHrr0PjA\nJ7hl83S6DCMYEsi5DvTGEtwbRcIoOV+EJHmgyVge2FOy5ZJSbzKdBIK5rqE9\n9Nd5ykzbZS4eQI9+dG0MzI1l9U6994bPMpDTCFj3apvVF3FdCN6iLsNdTMxP\njjA6FBzIjmOIWmaJwm9/y045yQdmWLTOe7/CAKQZbGIh7R7hRk63it1H7xou\nkypD8PySotNDW0K/pAsmPOfWM8QZVMHhx0Rb3ixEJcClC37NgaQorGA4Ppni\n0AIP\r\n=Ddzp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHa95HQxChTfDnBKJdDddujwVhTtAV0UkJ3CKCBobf3hAiEAjlMFe4GSuXoY76eOocLC9shMR2rJwCdWCoGecGs3sJg="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.18_1612032533620_0.5744855234708373"},"_hasShrinkwrap":false},"11.0.0-alpha.19":{"name":"interrupt","version":"11.0.0-alpha.19","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^2.0.0-alpha.0","keyify":"^2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^2.0.2"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\nInterrupt installs from NPM.\n\n```\nnpm install interrupt\n```\n\nExceptions are nice. I like the concept. I've always done my best to employ them\nin JavaScript and Node.js but it isn't always easy.\n\nInterrupt is a module I created to address the problems with JavaScript's\nlimited exception mechanism, solving the challenges I've encountered over the\nyears that I'm sure you've encountered as well. It is not an elegant solution,\nbut it is a solution none the less.\n\n## Advocacy\n\nInterrupt allows you to get exceptions that have a file name and line number\nfrom your program, instead of a stubby stack trace that points to the wilderness\nof the Node.js source, or [no stack trace at\nall](https://github.com/nodejs/node/issues/30944). It does this with some\nsyntactical struggle, but without the expensive superfluous stack trace\ngeneration of the long stack trace modules.\n\nInterrupt allows you to nest exceptions so you can provide application context\nto system and library exceptions.\n\nInterrupt allows you to cite multiple nested exceptions as the cause of your\ncontextual exception which is necessary if you're doing any sort of parallel\nasynchronous programming where multiple parallel paths can raise exceptions.\n\nInterrupt uses and abuses the `Error.stack` property provided by Google V8 to\ngenerate an elaborate report from `Error.stack` including the `Error` type,\nmessage, context properties, and stack trace along with the error messages and\nstack traces of all the nested errors.\n\nInterrupt's elaborate `Error.stack` is machine readable so you could conceivably\nprocess these stack traces programmatically after gathering them from production\nlogs.\n\nInterrupt can report it's elaborate stack trace de-duped with a count of similar\nexceptions so that when great many parallel operations raise the same you don't\nhave wade through the repetitive stack traces to see if there is anything unique\nabout one of them.\n\nInterrupt endeavours to do all this with a minimum of extra code and code paths\nso you can format exception messages with `sprintf-js`, set properties, specify\nnested expressions the constructor, often as a one-liner. **TODO** Basically\nadvocating one-liners, poorly worded.\n\nThis `README.md` is also a unit test using the\n[Proof](https://github.com/bigeasy/proof) unit test framework. We'll use the\nProof `okay` function to assert out statements in the readme. A Proof unit test\ngenerally looks like this.\n\n```javascript\nrequire('proof')(4, async okay => {\n    okay('always okay')\n    okay(true, 'okay if true')\n    okay(1, 1, 'okay if equal')\n    okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')\n})\n```\n\nYou can run this unit test yourself. The `--async-stack-traces` flag is not\nnecessary on Node.js 14 or above.\n\n```text\ngit clone git@github.com:bigeasy/interrupt.git\ncd interrupt\nnpm install --no-package-lock --no-save\nnode --async-stack-traces test/readme.t.js\n```\n\nThe only way to see the elaborate stack trace output is to run this test at the\ncommand line, so please do so. **TODO** No, we're going to fix that.\n\nInterrupt is targeted for Node.js 12 or greater. Note that we are running with\n`--async-stack-traces` enabled and to enjoy all the features discussed in this\nreadme you need to be running Node.js 14.\n\nThe Interrupt module exports an `Interrupt` constructor.\n\n```javascript\nconst Interrupt = require('interrupt')\n```\n\nAll of the examples in this code are _contrived_, and in practice, I'm\nnever quite this zealous with my use of exceptions or Interrupt.\n\n## Happy Path vs Error Path\n\nThroughout we'll be referring to the happy path and the error path.\n\nThe happy path is the path of code execution where everything goes as\nexpected. It is the code path that gets the most exercise, the path that\nreceives the most robust testing.\n\nThe error path is the path of code excution that is followed when things\ngo sideways. One would hope that the error path is not often executed\nduring normal operation. One would expect the error path to be followed\nas a result unforseen circumstances that might not have been considered\nduring development. Sadly, the error path usually does not receive a lot\nof testing. One should tread lightly on the error path.\n\nInterrupt endevours to be exacting on the happy path and accommodating on\nerror path. It has a lot of assertions on functions that are executed\nduring normal operation and a lot of fallbacks on the functions that are\nexecuted during exception handling.\n\nWhen we speak of the error path in this documenation, we are urging\ncaution and justifing our accommodations. When we speak of the happy path\nin this documentation we are urging rigor and justifying our assertions.\n\n## Errors by Code\n\nErrors in JavaScript have very little context information. The only\nproperties defined by the spec are `name` and `message`.\n\n**TODO** As of this writing, Interrupt is targeted for Node.js and Google\nV8 only, but can probably be ported to other JavaScript engines if\nsomeone would like to recommend a cross-browser development setup. I'm\nopen to porting if someone is interested.\n\nThe `message` is supposed to be human readable and because of this it\ndoesn't serve well as a programmatic indication of error type.\n\n```javascript\nconsole.log('\\n--- message only Errors ---\\n')\n\nconst path = require('path')\nconst fs = require('fs').promises\n\nasync function loadJSONConfiguration (filename) {\n    let json\n    try {\n        json = await fs.readFile(filename, '')\n    } catch (error) {\n        const e = new Error('file unreadable: ' + filename)\n        e.cause = error\n        throw e\n    }\n    let config\n    try {\n        config = JSON.parse(json)\n    } catch (error) {\n        const e = new Error('unable to parse configuration')\n        e.cause = error\n        throw e\n    }\n    if (config == null || typeof config != 'object' || Array.isArray(object)) {\n        throw new Error('JSON must be an object')\n    }\n    if (config.size == null) {\n        throw new Error('memory is a require configuration parameter')\n    }\n    if (config.size == null) {\n        throw new Error('memory configuration parameter must be a number')\n    }\n    return config\n}\n\nlet config\ntry {\n    config = await loadJSONConfiguration(path.join(__dirname, 'missing.txt'))\n} catch (error) {\n    console.log(`${error.stack}\\n`)\n    // If the file doesn't exist, use a default configuration, otherwise\n    // rethrow any configuration exceptions.\n    if (/file unreadable/.test(error.message) && error.cause.code == 'ENOENT') {\n        config = { size: 5 }\n    } else {\n        throw error\n    }\n}\n\nokay(config, { size: 5 }, 'used a default configuration (example)')\n```\n\nOther languages have the ability to catch an exception by type. This\nability to catch by type is where the idea for an exception class for\neach type of error comes from.\n\nJavaScript does not have this ability. Once the exception is caught it\nmust be filtered through an `if`/`else` ladder with `instanceof` to\ndetermine the type of exception. Using entire classes for what is\nessentially a flag is a heavyweight approach. The user now has to import\nthe module's exceptions into the namespace of their application to use\nthem as test conditions. Not only do we have to add this `if`/`else`\nladder, we have to our `require` statements start to look like this.\n\n```javascript\nconst { ConfigParseError, ConfigIOError, loadJSONConfiguration } = require('./config')\n```\n\nThis is so foreign to JavaScript, to use type information directly,\ninstead of using ploymorphism. Kinda feels like we're moving the\ninternals of a dependency into our module to check a flag.\n\nNode.js itself doesn't extend the error class heirarchy by much.  In\nfact, in our code we further test the cause of the I/O error by checking\na `code` property to see if it is a `ENOENT`, the POSIX code for a\nmissing file.\n\nThe Node.js libraries use a base `Error` class (with the exception of the\n`assert` module) and simply set a `code` on the error object. All of the\nerrors eminating from the standard Node.js modules have a `code` property\nand each `code` property has associated documentation.\n\nIf you use codes your module can adhere to this practice.\n\nInterrupt prefers to use codes as well. Interrupt encourages you to\ncreate a set of error codes for your module.\n\nYou can still create an Error object heirarchy using Interrupt, but once\nyou have a set of codes you start to see how they're easier to work with.\n\nYou declare your codes when you create your Interrupt derived class. You\ncan obtain a list of declared codes using the static `codes` property.\n\nIn the example below we declare a `ConfigError` class with an object\nthat maps the error codes to an error message. We can get a list of the\ncodes defined using the `codes` property of the generated class.\n\n```javascript\nokay(Interrupt.prototype instanceof Error, '`Interrupt` is an `Error`')\n\nconst ConfigError = Interrupt.create('ConfigError', {\n    IO_ERROR: 'unable to read config file',\n    PARSE_ERROR: 'unable to parse config file'\n})\n\nconst codes = ConfigError.codes\nokay(codes.sort(), [ 'IO_ERROR', 'PARSE_ERROR' ], 'set of generated error codes')\n\nokay(typeof ConfigError.IO_ERROR, 'symbol', 'constant that maps an error code name to a symbol')\nokay(typeof ConfigError.PARSE_ERROR, 'symbol', 'one for each error code')\n\nokay(ConfigError.prototype instanceof Interrupt, 'generated error is an `Interrupt`')\nokay(ConfigError.prototype instanceof Error, 'generated error is therefore also an `Error`')\n```\n","readmeFilename":"README.md","gitHead":"8c9d9e88eae1a4df69ae1f3ed71ddc05faaea571","_id":"interrupt@11.0.0-alpha.19","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-J4uQEziUFtjPG69oY5DAL77bLSr8DpuO3Z7ClX3JnBV5V1oqb4NQqgQt+CNK48+/O4XZqFZS9TomDYbi892hjA==","shasum":"20587e3047019a2fb38c900b07b82144234b0540","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.19.tgz","fileCount":6,"unpackedSize":98830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSuj2CRA9TVsSAnZWagAAo+4P/jrV7NikZ4nE9mltZs/D\nMbhFxi5qQ4KrH7kGDE39d05W83asppYNPndKenIxlR9/FCBTC41GHxJMgWfZ\nqtqhXq00wKZc85kpG2FPXZHz3qwDgTWBriiNwOE7HIIUHQ891njWXyRdFJAt\nwgRJ2a7SgbyGzkuz0jqTavR79KUPlkiPHqptnAfQn7heXK4+wuGo/hE2kTST\niysWx5OdLSB/bCjN+9WRKQd+qHBeBX1J1vYAPlMk9zBrNzKYCjoVFlv18HxF\nm5Av6PT5Cur2msmGUF7oOC3yyxjAlY6blPhKkrTO+W/T95xmVbsq9FqSgI4s\nw+ugwy9gjkgD7A9H6aOCX4glPNJjdLCyZ0B7BA2b+f5wjje9Txhkufw4IIqE\n5KOO/4m0WYxUvwIw2gUZiPDXskDR1DMlmSNNLI9TkoEJy8g65ZCQd8/H5O77\nx4n1G88a1JE59rFL3xFD0d6IjhuukSZk/YN7UxeihQRZCgQsZeLixaKO1hD9\ntMliPA3pEIiXcBmIJ0pDYyfeCt70TfKUXPXQZLn/drgLqnJ9ESB+uYPXBL+q\nBdDwVY8utTfAkTp3RZPwU5Dou1uH6/p9J5DPQ/9wmliWcYDOIaKlGi/H3Swh\nnXefeA9Qk5HjMSwbiFkCDeeY32FJP2atBvdHqWu2wTkP7vuMO35/ascsB5sB\nsYwH\r\n=JbJC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtKoe+6Iyd1KO9Q9iq/fEUZdCniHXro7wKM+OOpFNkKQIhANGL0OqwHsiio1Yf24Xj/DmML7UrMEWIdz1J1Vtju59t"}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.19_1615522037009_0.2599976789872105"},"_hasShrinkwrap":false},"11.0.0-alpha.20":{"name":"interrupt","version":"11.0.0-alpha.20","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^2.0.0-alpha.0","keyify":"^2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^2.0.2"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\nInterrupt installs from NPM.\n\n```\nnpm install interrupt\n```\n\nExceptions are nice. I like the concept. I've always done my best to employ them\nin JavaScript and Node.js but it isn't always easy.\n\nInterrupt is a module I created to address the problems with JavaScript's\nlimited exception mechanism, solving the challenges I've encountered over the\nyears that I'm sure you've encountered as well. It is not an elegant solution,\nbut it is a solution none the less.\n\n## Advocacy\n\nInterrupt allows you to get exceptions that have a file name and line number\nfrom your program, instead of a stubby stack trace that points to the wilderness\nof the Node.js source, or [no stack trace at\nall](https://github.com/nodejs/node/issues/30944). It does this with some\nsyntactical struggle, but without the expensive superfluous stack trace\ngeneration of the long stack trace modules.\n\nInterrupt allows you to nest exceptions so you can provide application context\nto system and library exceptions.\n\nInterrupt allows you to cite multiple nested exceptions as the cause of your\ncontextual exception which is necessary if you're doing any sort of parallel\nasynchronous programming where multiple parallel paths can raise exceptions.\n\nInterrupt uses and abuses the `Error.stack` property provided by Google V8 to\ngenerate an elaborate report from `Error.stack` including the `Error` type,\nmessage, context properties, and stack trace along with the error messages and\nstack traces of all the nested errors.\n\nInterrupt's elaborate `Error.stack` is machine readable so you could conceivably\nprocess these stack traces programmatically after gathering them from production\nlogs.\n\nInterrupt can report it's elaborate stack trace de-duped with a count of similar\nexceptions so that when great many parallel operations raise the same you don't\nhave wade through the repetitive stack traces to see if there is anything unique\nabout one of them.\n\nInterrupt endeavours to do all this with a minimum of extra code and code paths\nso you can format exception messages with `sprintf-js`, set properties, specify\nnested expressions the constructor, often as a one-liner. **TODO** Basically\nadvocating one-liners, poorly worded.\n\nThis `README.md` is also a unit test using the\n[Proof](https://github.com/bigeasy/proof) unit test framework. We'll use the\nProof `okay` function to assert out statements in the readme. A Proof unit test\ngenerally looks like this.\n\n```javascript\nrequire('proof')(4, async okay => {\n    okay('always okay')\n    okay(true, 'okay if true')\n    okay(1, 1, 'okay if equal')\n    okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')\n})\n```\n\nYou can run this unit test yourself. The `--async-stack-traces` flag is not\nnecessary on Node.js 14 or above.\n\n```text\ngit clone git@github.com:bigeasy/interrupt.git\ncd interrupt\nnpm install --no-package-lock --no-save\nnode --async-stack-traces test/readme.t.js\n```\n\nThe only way to see the elaborate stack trace output is to run this test at the\ncommand line, so please do so. **TODO** No, we're going to fix that.\n\nInterrupt is targeted for Node.js 12 or greater. Note that we are running with\n`--async-stack-traces` enabled and to enjoy all the features discussed in this\nreadme you need to be running Node.js 14.\n\nThe Interrupt module exports an `Interrupt` constructor.\n\n```javascript\nconst Interrupt = require('interrupt')\n```\n\nAll of the examples in this code are _contrived_, and in practice, I'm\nnever quite this zealous with my use of exceptions or Interrupt.\n\n## Happy Path vs Error Path\n\nThroughout we'll be referring to the happy path and the error path.\n\nThe happy path is the path of code execution where everything goes as\nexpected. It is the code path that gets the most exercise, the path that\nreceives the most robust testing.\n\nThe error path is the path of code excution that is followed when things\ngo sideways. One would hope that the error path is not often executed\nduring normal operation. One would expect the error path to be followed\nas a result unforseen circumstances that might not have been considered\nduring development. Sadly, the error path usually does not receive a lot\nof testing. One should tread lightly on the error path.\n\nInterrupt endevours to be exacting on the happy path and accommodating on\nerror path. It has a lot of assertions on functions that are executed\nduring normal operation and a lot of fallbacks on the functions that are\nexecuted during exception handling.\n\nWhen we speak of the error path in this documenation, we are urging\ncaution and justifing our accommodations. When we speak of the happy path\nin this documentation we are urging rigor and justifying our assertions.\n\n## Errors by Code\n\nErrors in JavaScript have very little context information. The only\nproperties defined by the spec are `name` and `message`.\n\n**TODO** As of this writing, Interrupt is targeted for Node.js and Google\nV8 only, but can probably be ported to other JavaScript engines if\nsomeone would like to recommend a cross-browser development setup. I'm\nopen to porting if someone is interested.\n\nThe `message` is supposed to be human readable and because of this it\ndoesn't serve well as a programmatic indication of error type.\n\n```javascript\nconsole.log('\\n--- message only Errors ---\\n')\n\nconst path = require('path')\nconst fs = require('fs').promises\n\nasync function loadJSONConfiguration (filename) {\n    let json\n    try {\n        json = await fs.readFile(filename, '')\n    } catch (error) {\n        const e = new Error('file unreadable: ' + filename)\n        e.cause = error\n        throw e\n    }\n    let config\n    try {\n        config = JSON.parse(json)\n    } catch (error) {\n        const e = new Error('unable to parse configuration')\n        e.cause = error\n        throw e\n    }\n    if (config == null || typeof config != 'object' || Array.isArray(object)) {\n        throw new Error('JSON must be an object')\n    }\n    if (config.size == null) {\n        throw new Error('memory is a require configuration parameter')\n    }\n    if (config.size == null) {\n        throw new Error('memory configuration parameter must be a number')\n    }\n    return config\n}\n\nlet config\ntry {\n    config = await loadJSONConfiguration(path.join(__dirname, 'missing.txt'))\n} catch (error) {\n    console.log(`${error.stack}\\n`)\n    // If the file doesn't exist, use a default configuration, otherwise\n    // rethrow any configuration exceptions.\n    if (/file unreadable/.test(error.message) && error.cause.code == 'ENOENT') {\n        config = { size: 5 }\n    } else {\n        throw error\n    }\n}\n\nokay(config, { size: 5 }, 'used a default configuration (example)')\n```\n\nOther languages have the ability to catch an exception by type. This\nability to catch by type is where the idea for an exception class for\neach type of error comes from.\n\nJavaScript does not have this ability. Once the exception is caught it\nmust be filtered through an `if`/`else` ladder with `instanceof` to\ndetermine the type of exception. Using entire classes for what is\nessentially a flag is a heavyweight approach. The user now has to import\nthe module's exceptions into the namespace of their application to use\nthem as test conditions. Not only do we have to add this `if`/`else`\nladder, we have to our `require` statements start to look like this.\n\n```javascript\nconst { ConfigParseError, ConfigIOError, loadJSONConfiguration } = require('./config')\n```\n\nThis is so foreign to JavaScript, to use type information directly,\ninstead of using ploymorphism. Kinda feels like we're moving the\ninternals of a dependency into our module to check a flag.\n\nNode.js itself doesn't extend the error class heirarchy by much.  In\nfact, in our code we further test the cause of the I/O error by checking\na `code` property to see if it is a `ENOENT`, the POSIX code for a\nmissing file.\n\nThe Node.js libraries use a base `Error` class (with the exception of the\n`assert` module) and simply set a `code` on the error object. All of the\nerrors eminating from the standard Node.js modules have a `code` property\nand each `code` property has associated documentation.\n\nIf you use codes your module can adhere to this practice.\n\nInterrupt prefers to use codes as well. Interrupt encourages you to\ncreate a set of error codes for your module.\n\nYou can still create an Error object heirarchy using Interrupt, but once\nyou have a set of codes you start to see how they're easier to work with.\n\nYou declare your codes when you create your Interrupt derived class. You\ncan obtain a list of declared codes using the static `codes` property.\n\nIn the example below we declare a `ConfigError` class with an object\nthat maps the error codes to an error message. We can get a list of the\ncodes defined using the `codes` property of the generated class.\n\n```javascript\nokay(Interrupt.prototype instanceof Error, '`Interrupt` is an `Error`')\n\nconst ConfigError = Interrupt.create('ConfigError', {\n    IO_ERROR: 'unable to read config file',\n    PARSE_ERROR: 'unable to parse config file'\n})\n\nconst codes = ConfigError.codes\nokay(codes.sort(), [ 'IO_ERROR', 'PARSE_ERROR' ], 'set of generated error codes')\n\nokay(typeof ConfigError.IO_ERROR, 'symbol', 'constant that maps an error code name to a symbol')\nokay(typeof ConfigError.PARSE_ERROR, 'symbol', 'one for each error code')\n\nokay(ConfigError.prototype instanceof Interrupt, 'generated error is an `Interrupt`')\nokay(ConfigError.prototype instanceof Error, 'generated error is therefore also an `Error`')\n```\n","readmeFilename":"README.md","gitHead":"ae6d69a0a66363d30d585aa578277f6ecff9d453","_id":"interrupt@11.0.0-alpha.20","_nodeVersion":"15.3.0","_npmVersion":"7.0.14","dist":{"integrity":"sha512-PDRUiH3VZNMfS+ZAnuBvUB4pW+8z3ak5fZ9jClQgc+r7ScOA5ugb7hb2BrSdgBy3wO3S0ALgdId9i/W3uiUQkA==","shasum":"cd2f3f98aa5206c7470add1cb6bb05f508017113","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.20.tgz","fileCount":6,"unpackedSize":99142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSz99CRA9TVsSAnZWagAAk3cP/RejcXSP/eEUm9wAMjps\nvstUIxIO3YPFZWHaAXkI5aSY+PFBt4Iqfg63L+9MXlu/ANJ4rvbiWqMc8xjz\nELO0umwaNzyHR53l8ZYPojupJnRKs0uox5feCB0zKbVUPjdnFUI3FhyXKgkd\nbFVktKFFKawOuVhDSjHCC9ys42KdIyGwPGHrZuvLDBQOSFCxgmuW1RAPknO+\niQZJ3+tTVBH7+wdjw/OVQZhMI4WuyzJtzZ9ekBml7HmS0TRcY2j8YMUQ07ua\nbKEvy0yZ2C4Qjff8/JWPdqmKgnvERpE+WhxGcWKldGQUMGxwbVGkB+CuAjXA\nFzXgxeDOPv32+yX1at1v64U+2vV3uHQO7O2jU9lssX9uNn9g3LuD5igZmtrd\nziF8ULtFRDvhdqWYcswfKP6l+z8pdHN5WFI6DA4j6uFdFGLV4YMtgzsKc77s\nTgqS9KFfIakgMEwmau+S9OPK5DfLzd/pXwUlnUIA57BJssYIVJY+yqWsXdHb\n+n93HA8v7Acz/u3RF1eTu3/FM8vMImhxVA0ZhMrt9cC4QflLrAzdAFDFkVyU\nNTRNj0+aLZnvEDrYyZsTCoMUdGsE03pV7sQnNj2tMv3Ejo95uXBW4WNbVMI8\nM2zA72UdbvtOU4o1/lCiOdQ1u9Liifnut8YmMkKUDMQhm1HSMjGChgoq48bY\niLaX\r\n=ohwz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1K3P8WDue3jy+wQic6Hw5sWSmNYu/F1vDJjNcu2RChAIhAN66++JYy9bP9qTsMbTgfTVpQxY9LGafRiWTC90xtxMb"}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.20_1615544188530_0.4143244277586633"},"_hasShrinkwrap":false},"11.0.0-alpha.21":{"name":"interrupt","version":"11.0.0-alpha.21","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^2.0.0-alpha.0","keyify":"^2.0.5","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^2.0.2"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\nInterrupt installs from NPM.\n\n```\nnpm install interrupt\n```\n\nExceptions are nice. I like the concept. I've always done my best to employ them\nin JavaScript and Node.js but it isn't always easy.\n\nInterrupt is a module I created to address the problems with JavaScript's\nlimited exception mechanism, solving the challenges I've encountered over the\nyears that I'm sure you've encountered as well. It is not an elegant solution,\nbut it is a solution none the less.\n\n## Advocacy\n\nInterrupt allows you to get exceptions that have a file name and line number\nfrom your program, instead of a stubby stack trace that points to the wilderness\nof the Node.js source, or [no stack trace at\nall](https://github.com/nodejs/node/issues/30944). It does this with some\nsyntactical struggle, but without the expensive superfluous stack trace\ngeneration of the long stack trace modules.\n\nInterrupt allows you to nest exceptions so you can provide application context\nto system and library exceptions.\n\nInterrupt allows you to cite multiple nested exceptions as the cause of your\ncontextual exception which is necessary if you're doing any sort of parallel\nasynchronous programming where multiple parallel paths can raise exceptions.\n\nInterrupt uses and abuses the `Error.stack` property provided by Google V8 to\ngenerate an elaborate report from `Error.stack` including the `Error` type,\nmessage, context properties, and stack trace along with the error messages and\nstack traces of all the nested errors.\n\nInterrupt's elaborate `Error.stack` is machine readable so you could conceivably\nprocess these stack traces programmatically after gathering them from production\nlogs.\n\nInterrupt can report it's elaborate stack trace de-duped with a count of similar\nexceptions so that when great many parallel operations raise the same you don't\nhave wade through the repetitive stack traces to see if there is anything unique\nabout one of them.\n\nInterrupt endeavours to do all this with a minimum of extra code and code paths\nso you can format exception messages with `sprintf-js`, set properties, specify\nnested expressions the constructor, often as a one-liner. **TODO** Basically\nadvocating one-liners, poorly worded.\n\nThis `README.md` is also a unit test using the\n[Proof](https://github.com/bigeasy/proof) unit test framework. We'll use the\nProof `okay` function to assert out statements in the readme. A Proof unit test\ngenerally looks like this.\n\n```javascript\nrequire('proof')(4, async okay => {\n    okay('always okay')\n    okay(true, 'okay if true')\n    okay(1, 1, 'okay if equal')\n    okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')\n})\n```\n\nYou can run this unit test yourself. The `--async-stack-traces` flag is not\nnecessary on Node.js 14 or above.\n\n```text\ngit clone git@github.com:bigeasy/interrupt.git\ncd interrupt\nnpm install --no-package-lock --no-save\nnode --async-stack-traces test/readme.t.js\n```\n\nThe only way to see the elaborate stack trace output is to run this test at the\ncommand line, so please do so. **TODO** No, we're going to fix that.\n\nInterrupt is targeted for Node.js 12 or greater. Note that we are running with\n`--async-stack-traces` enabled and to enjoy all the features discussed in this\nreadme you need to be running Node.js 14.\n\nThe Interrupt module exports an `Interrupt` constructor.\n\n```javascript\nconst Interrupt = require('interrupt')\n```\n\nAll of the examples in this code are _contrived_, and in practice, I'm\nnever quite this zealous with my use of exceptions or Interrupt.\n\n## Happy Path vs Error Path\n\nThroughout we'll be referring to the happy path and the error path.\n\nThe happy path is the path of code execution where everything goes as\nexpected. It is the code path that gets the most exercise, the path that\nreceives the most robust testing.\n\nThe error path is the path of code excution that is followed when things\ngo sideways. One would hope that the error path is not often executed\nduring normal operation. One would expect the error path to be followed\nas a result unforseen circumstances that might not have been considered\nduring development. Sadly, the error path usually does not receive a lot\nof testing. One should tread lightly on the error path.\n\nInterrupt endevours to be exacting on the happy path and accommodating on\nerror path. It has a lot of assertions on functions that are executed\nduring normal operation and a lot of fallbacks on the functions that are\nexecuted during exception handling.\n\nWhen we speak of the error path in this documenation, we are urging\ncaution and justifing our accommodations. When we speak of the happy path\nin this documentation we are urging rigor and justifying our assertions.\n\n## Errors by Code\n\nErrors in JavaScript have very little context information. The only\nproperties defined by the spec are `name` and `message`.\n\n**TODO** As of this writing, Interrupt is targeted for Node.js and Google\nV8 only, but can probably be ported to other JavaScript engines if\nsomeone would like to recommend a cross-browser development setup. I'm\nopen to porting if someone is interested.\n\nThe `message` is supposed to be human readable and because of this it\ndoesn't serve well as a programmatic indication of error type.\n\n```javascript\nconsole.log('\\n--- message only Errors ---\\n')\n\nconst path = require('path')\nconst fs = require('fs').promises\n\nasync function loadJSONConfiguration (filename) {\n    let json\n    try {\n        json = await fs.readFile(filename, '')\n    } catch (error) {\n        const e = new Error('file unreadable: ' + filename)\n        e.cause = error\n        throw e\n    }\n    let config\n    try {\n        config = JSON.parse(json)\n    } catch (error) {\n        const e = new Error('unable to parse configuration')\n        e.cause = error\n        throw e\n    }\n    if (config == null || typeof config != 'object' || Array.isArray(object)) {\n        throw new Error('JSON must be an object')\n    }\n    if (config.size == null) {\n        throw new Error('memory is a require configuration parameter')\n    }\n    if (config.size == null) {\n        throw new Error('memory configuration parameter must be a number')\n    }\n    return config\n}\n\nlet config\ntry {\n    config = await loadJSONConfiguration(path.join(__dirname, 'missing.txt'))\n} catch (error) {\n    console.log(`${error.stack}\\n`)\n    // If the file doesn't exist, use a default configuration, otherwise\n    // rethrow any configuration exceptions.\n    if (/file unreadable/.test(error.message) && error.cause.code == 'ENOENT') {\n        config = { size: 5 }\n    } else {\n        throw error\n    }\n}\n\nokay(config, { size: 5 }, 'used a default configuration (example)')\n```\n\nOther languages have the ability to catch an exception by type. This\nability to catch by type is where the idea for an exception class for\neach type of error comes from.\n\nJavaScript does not have this ability. Once the exception is caught it\nmust be filtered through an `if`/`else` ladder with `instanceof` to\ndetermine the type of exception. Using entire classes for what is\nessentially a flag is a heavyweight approach. The user now has to import\nthe module's exceptions into the namespace of their application to use\nthem as test conditions. Not only do we have to add this `if`/`else`\nladder, we have to our `require` statements start to look like this.\n\n```javascript\nconst { ConfigParseError, ConfigIOError, loadJSONConfiguration } = require('./config')\n```\n\nThis is so foreign to JavaScript, to use type information directly,\ninstead of using ploymorphism. Kinda feels like we're moving the\ninternals of a dependency into our module to check a flag.\n\nNode.js itself doesn't extend the error class heirarchy by much.  In\nfact, in our code we further test the cause of the I/O error by checking\na `code` property to see if it is a `ENOENT`, the POSIX code for a\nmissing file.\n\nThe Node.js libraries use a base `Error` class (with the exception of the\n`assert` module) and simply set a `code` on the error object. All of the\nerrors eminating from the standard Node.js modules have a `code` property\nand each `code` property has associated documentation.\n\nIf you use codes your module can adhere to this practice.\n\nInterrupt prefers to use codes as well. Interrupt encourages you to\ncreate a set of error codes for your module.\n\nYou can still create an Error object heirarchy using Interrupt, but once\nyou have a set of codes you start to see how they're easier to work with.\n\nYou declare your codes when you create your Interrupt derived class. You\ncan obtain a list of declared codes using the static `codes` property.\n\nIn the example below we declare a `ConfigError` class with an object\nthat maps the error codes to an error message. We can get a list of the\ncodes defined using the `codes` property of the generated class.\n\n```javascript\nokay(Interrupt.prototype instanceof Error, '`Interrupt` is an `Error`')\n\nconst ConfigError = Interrupt.create('ConfigError', {\n    IO_ERROR: 'unable to read config file',\n    PARSE_ERROR: 'unable to parse config file'\n})\n\nconst codes = ConfigError.codes\nokay(codes.sort(), [ 'IO_ERROR', 'PARSE_ERROR' ], 'set of generated error codes')\n\nokay(typeof ConfigError.IO_ERROR, 'symbol', 'constant that maps an error code name to a symbol')\nokay(typeof ConfigError.PARSE_ERROR, 'symbol', 'one for each error code')\n\nokay(ConfigError.prototype instanceof Interrupt, 'generated error is an `Interrupt`')\nokay(ConfigError.prototype instanceof Error, 'generated error is therefore also an `Error`')\n```\n","readmeFilename":"README.md","gitHead":"05e40ce74cfd6541e87a04dbd59d32ad8c43abde","_id":"interrupt@11.0.0-alpha.21","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5FzWlxgMLWVitqtctjKIyQ0jniyBhj7/yS9lMLVP+wOxSkukE+qg2r9EzfVPIB1oiGTBr293S2JmiIENcy53Gg==","shasum":"c89b479dfe6fb02a24ccdfb01038f517398dcee9","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.21.tgz","fileCount":6,"unpackedSize":99142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+cNXCRA9TVsSAnZWagAAsDYP/jmsuDO5Qrv9eBX8eWOS\nICAyGuBWV9doqiMj5L03ResXixMpg4qCE7m3cC1BZF/3QVyK9wphxIC3yUgr\noWq6o6SNKn+u1BnGAI7Bd8apLlQpHbSbqdJ9s4LmTt6j2QKQBBLe7UP/ZCj1\nHQf+Ne2yKtP29x6pbGu1FmPK5I8ZY0rHfIwDYoPO2A77v8kcT/kGFyb7hr7z\nQ8GXAK6iv15aiNDC6s/vLxFODgjUV8rFQp4BDmLTLG3dcdff5neB5mbwImdt\noyPtra1YdxPGEM/y0CQr+K0Ef3F4uEMZPbjRNaT0Djcl38YfAdmD7ZEPObgL\n7rgOWvyyTourSIA/biWVmy1gpobFqDUqkc7+DSiGBl1hePU0f/JdGakiPkoR\nsfsC7Wr+cnUuurifl0qWv9biQmfv6SgYqpz3MUwjRs/RrUa/cHnwRaCKRktU\nOtCUPzIPTKaftyxXk0fxtcjKYhJijan6pROACnIADsKWLHk66JrbVQ6RRbnx\nEmJE2mYVAm5C4NNNMm8bF94tZJW+KnjINxALedJx3dStjTzQZ8I7y52Za5vE\nWDMoTOv2E5lqesLtwDCI0hbP2N1g+tAIS3ptjsy1pzh5DQuxOj2R9yb9s4QQ\n+XAiY6Vsq1DKFWHHFs059MCo2v8BNYt4fP/JV2Ii5k7uqzQi9VM7CbygO+Pa\ncb/j\r\n=YFQ3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID57TkUhrayXgueiDQzu0hpECDHcDFErRlD0EfPErVAYAiAUbBU0UqvXfOYAJDctqk4pT4nII4ucqskMo7N2z/NJPA=="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.21_1626981206823_0.6746105040677357"},"_hasShrinkwrap":false},"11.0.0-alpha.23":{"name":"interrupt","version":"11.0.0-alpha.23","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^2.0.0-alpha.2","keyify":"^3.0.0","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^3.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\nInterrupt installs from NPM.\n\n```\nnpm install interrupt\n```\n\nExceptions are nice. I like the concept. I've always done my best to employ them\nin JavaScript and Node.js but it isn't always easy.\n\nInterrupt is a module I created to address the problems with JavaScript's\nlimited exception mechanism, solving the challenges I've encountered over the\nyears that I'm sure you've encountered as well. It is not an elegant solution,\nbut it is a solution none the less.\n\n## Advocacy\n\nInterrupt allows you to get exceptions that have a file name and line number\nfrom your program, instead of a stubby stack trace that points to the wilderness\nof the Node.js source, or [no stack trace at\nall](https://github.com/nodejs/node/issues/30944). It does this with some\nsyntactical struggle, but without the expensive superfluous stack trace\ngeneration of the long stack trace modules.\n\nInterrupt allows you to nest exceptions so you can provide application context\nto system and library exceptions.\n\nInterrupt allows you to cite multiple nested exceptions as the cause of your\ncontextual exception which is necessary if you're doing any sort of parallel\nasynchronous programming where multiple parallel paths can raise exceptions.\n\nInterrupt uses and abuses the `Error.stack` property provided by Google V8 to\ngenerate an elaborate report from `Error.stack` including the `Error` type,\nmessage, context properties, and stack trace along with the error messages and\nstack traces of all the nested errors.\n\nInterrupt's elaborate `Error.stack` is machine readable so you could conceivably\nprocess these stack traces programmatically after gathering them from production\nlogs.\n\nInterrupt can report it's elaborate stack trace de-duped with a count of similar\nexceptions so that when great many parallel operations raise the same you don't\nhave wade through the repetitive stack traces to see if there is anything unique\nabout one of them.\n\nInterrupt endeavours to do all this with a minimum of extra code and code paths\nso you can format exception messages with `sprintf-js`, set properties, specify\nnested expressions the constructor, often as a one-liner. **TODO** Basically\nadvocating one-liners, poorly worded.\n\nThis `README.md` is also a unit test using the\n[Proof](https://github.com/bigeasy/proof) unit test framework. We'll use the\nProof `okay` function to assert out statements in the readme. A Proof unit test\ngenerally looks like this.\n\n```javascript\nrequire('proof')(4, async okay => {\n    okay('always okay')\n    okay(true, 'okay if true')\n    okay(1, 1, 'okay if equal')\n    okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')\n})\n```\n\nYou can run this unit test yourself. The `--async-stack-traces` flag is not\nnecessary on Node.js 14 or above.\n\n```text\ngit clone git@github.com:bigeasy/interrupt.git\ncd interrupt\nnpm install --no-package-lock --no-save\nnode --async-stack-traces test/readme.t.js\n```\n\nThe only way to see the elaborate stack trace output is to run this test at the\ncommand line, so please do so. **TODO** No, we're going to fix that.\n\nInterrupt is targeted for Node.js 12 or greater. Note that we are running with\n`--async-stack-traces` enabled and to enjoy all the features discussed in this\nreadme you need to be running Node.js 14.\n\nThe Interrupt module exports an `Interrupt` constructor.\n\n```javascript\nconst Interrupt = require('interrupt')\n```\n\nAll of the examples in this code are _contrived_, and in practice, I'm\nnever quite this zealous with my use of exceptions or Interrupt.\n\n## Happy Path vs Error Path\n\nThroughout we'll be referring to the happy path and the error path.\n\nThe happy path is the path of code execution where everything goes as\nexpected. It is the code path that gets the most exercise, the path that\nreceives the most robust testing.\n\nThe error path is the path of code excution that is followed when things\ngo sideways. One would hope that the error path is not often executed\nduring normal operation. One would expect the error path to be followed\nas a result unforseen circumstances that might not have been considered\nduring development. Sadly, the error path usually does not receive a lot\nof testing. One should tread lightly on the error path.\n\nInterrupt endevours to be exacting on the happy path and accommodating on\nerror path. It has a lot of assertions on functions that are executed\nduring normal operation and a lot of fallbacks on the functions that are\nexecuted during exception handling.\n\nWhen we speak of the error path in this documenation, we are urging\ncaution and justifing our accommodations. When we speak of the happy path\nin this documentation we are urging rigor and justifying our assertions.\n\n## Errors by Code\n\nErrors in JavaScript have very little context information. The only\nproperties defined by the spec are `name` and `message`.\n\n**TODO** As of this writing, Interrupt is targeted for Node.js and Google\nV8 only, but can probably be ported to other JavaScript engines if\nsomeone would like to recommend a cross-browser development setup. I'm\nopen to porting if someone is interested.\n\nThe `message` is supposed to be human readable and because of this it\ndoesn't serve well as a programmatic indication of error type.\n\n```javascript\nconsole.log('\\n--- message only Errors ---\\n')\n\nconst path = require('path')\nconst fs = require('fs').promises\n\nasync function loadJSONConfiguration (filename) {\n    let json\n    try {\n        json = await fs.readFile(filename, '')\n    } catch (error) {\n        const e = new Error('file unreadable: ' + filename)\n        e.cause = error\n        throw e\n    }\n    let config\n    try {\n        config = JSON.parse(json)\n    } catch (error) {\n        const e = new Error('unable to parse configuration')\n        e.cause = error\n        throw e\n    }\n    if (config == null || typeof config != 'object' || Array.isArray(object)) {\n        throw new Error('JSON must be an object')\n    }\n    if (config.size == null) {\n        throw new Error('memory is a require configuration parameter')\n    }\n    if (config.size == null) {\n        throw new Error('memory configuration parameter must be a number')\n    }\n    return config\n}\n\nlet config\ntry {\n    config = await loadJSONConfiguration(path.join(__dirname, 'missing.txt'))\n} catch (error) {\n    console.log(`${error.stack}\\n`)\n    // If the file doesn't exist, use a default configuration, otherwise\n    // rethrow any configuration exceptions.\n    if (/file unreadable/.test(error.message) && error.cause.code == 'ENOENT') {\n        config = { size: 5 }\n    } else {\n        throw error\n    }\n}\n\nokay(config, { size: 5 }, 'used a default configuration (example)')\n```\n\nOther languages have the ability to catch an exception by type. This\nability to catch by type is where the idea for an exception class for\neach type of error comes from.\n\nJavaScript does not have this ability. Once the exception is caught it\nmust be filtered through an `if`/`else` ladder with `instanceof` to\ndetermine the type of exception. Using entire classes for what is\nessentially a flag is a heavyweight approach. The user now has to import\nthe module's exceptions into the namespace of their application to use\nthem as test conditions. Not only do we have to add this `if`/`else`\nladder, we have to our `require` statements start to look like this.\n\n```javascript\nconst { ConfigParseError, ConfigIOError, loadJSONConfiguration } = require('./config')\n```\n\nThis is so foreign to JavaScript, to use type information directly,\ninstead of using ploymorphism. Kinda feels like we're moving the\ninternals of a dependency into our module to check a flag.\n\nNode.js itself doesn't extend the error class heirarchy by much.  In\nfact, in our code we further test the cause of the I/O error by checking\na `code` property to see if it is a `ENOENT`, the POSIX code for a\nmissing file.\n\nThe Node.js libraries use a base `Error` class (with the exception of the\n`assert` module) and simply set a `code` on the error object. All of the\nerrors eminating from the standard Node.js modules have a `code` property\nand each `code` property has associated documentation.\n\nIf you use codes your module can adhere to this practice.\n\nInterrupt prefers to use codes as well. Interrupt encourages you to\ncreate a set of error codes for your module.\n\nYou can still create an Error object heirarchy using Interrupt, but once\nyou have a set of codes you start to see how they're easier to work with.\n\nYou declare your codes when you create your Interrupt derived class. You\ncan obtain a list of declared codes using the static `codes` property.\n\nIn the example below we declare a `ConfigError` class with an object\nthat maps the error codes to an error message. We can get a list of the\ncodes defined using the `codes` property of the generated class.\n\n```javascript\nokay(Interrupt.prototype instanceof Error, '`Interrupt` is an `Error`')\n\nconst ConfigError = Interrupt.create('ConfigError', {\n    IO_ERROR: 'unable to read config file',\n    PARSE_ERROR: 'unable to parse config file'\n})\n\nconst codes = ConfigError.codes\nokay(codes.sort(), [ 'IO_ERROR', 'PARSE_ERROR' ], 'set of generated error codes')\n\nokay(typeof ConfigError.IO_ERROR, 'symbol', 'constant that maps an error code name to a symbol')\nokay(typeof ConfigError.PARSE_ERROR, 'symbol', 'one for each error code')\n\nokay(ConfigError.prototype instanceof Interrupt, 'generated error is an `Interrupt`')\nokay(ConfigError.prototype instanceof Error, 'generated error is therefore also an `Error`')\n```\n","readmeFilename":"README.md","gitHead":"1486e64b66c67eac11138a3296a6bbc93bc4bb27","_id":"interrupt@11.0.0-alpha.23","_nodeVersion":"16.5.0","_npmVersion":"7.19.1","dist":{"integrity":"sha512-EdoNiKZtkGIFiO109EY/b+cr9dxAJ8t8PglOYyAqBLNbWO8PDdmZ85R33QZTR5ciReNBG1D7GTdHdQlQ+cPWHA==","shasum":"f42e1688c32710fc10823d2b4cbfe665a0c56f55","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.23.tgz","fileCount":6,"unpackedSize":99142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+lEaCRA9TVsSAnZWagAAGgYQAJthtl+GhgmCb/xfZZXp\nh/lzzzME+aMirswkiAbkS0+W77MnUcY5Rqk7ReUGfOHX6POZaOy+IqbVyB8v\nNobtPI6MbSsUK9eiSI8brUByQPYjyCvHnEjSWSEKA+hJkw5OUY+M0+0/jwLU\nJaS1FoWlaGIX1YWzrtML8yKb0le3xGMWD8xBMppcCDST6nzBjwQK4tnuW3sj\nBtks43X2GKT9+P+DyxXy2tizXOpBK91DgkkGdUqrRnAqskbQGgv6L2OPY/Gd\n6pWOjswSvtQ9fZUtN15yS0fGxhVJaQBhwiNj2T2JyPIrIvY26kEsctg2B4ZZ\ncPGYLmhbcONlZyd6ECCsRsZnig6nbAGoiVn5tYFDRTJauAmm9whFUTAyST9B\nY4fuBf8JDe1lNpSF4dK3lpxkJdmeo5OYkd44ZoKrXlzqtxfcu5/oRqHyk/Ui\nXsbYDqblWUK0jd6tRLic5M7yIN+tR/o5AT6D1nB5Ejl8EV2ni//LPMW6fgNV\n49ep/oOWBpDmXyt3t9uOBm4V3aQs+kDJtUZD1D0RJzqyWnJsCqiaTb06w3ob\nBkXEzx6fipyUdEg660l6rqauGU/hveTxL+IUFt6yfzZB2EtH86VWwtuCjiY4\nZpSa6+hK270M5SzURZSgmEO0hCfhJlyJ8R0wTleKMo7EVTxbgQmhN3rJXDVH\nyZM+\r\n=r0+t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOQ+xJPTDFsugS35utuaZ2AsDgtYZw2ImGRlMHQiSVnAIhAP3QvAINopz0xVjTPWkLwDIKlk0NMt0k5Ui7e4pKKqc2"}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.23_1627017498103_0.9180479148632281"},"_hasShrinkwrap":false},"11.0.0-alpha.24":{"name":"interrupt","version":"11.0.0-alpha.24","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^2.0.0-alpha.3","keyify":"^3.0.0","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^3.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\nInterrupt installs from NPM.\n\n```\nnpm install interrupt\n```\n\nExceptions are nice. I like the concept. I've always done my best to employ them\nin JavaScript and Node.js but it isn't always easy.\n\nInterrupt is a module I created to address the problems with JavaScript's\nlimited exception mechanism, solving the challenges I've encountered over the\nyears that I'm sure you've encountered as well. It is not an elegant solution,\nbut it is a solution none the less.\n\n## Advocacy\n\nInterrupt allows you to get exceptions that have a file name and line number\nfrom your program, instead of a stubby stack trace that points to the wilderness\nof the Node.js source, or [no stack trace at\nall](https://github.com/nodejs/node/issues/30944). It does this with some\nsyntactical struggle, but without the expensive superfluous stack trace\ngeneration of the long stack trace modules.\n\nInterrupt allows you to nest exceptions so you can provide application context\nto system and library exceptions.\n\nInterrupt allows you to cite multiple nested exceptions as the cause of your\ncontextual exception which is necessary if you're doing any sort of parallel\nasynchronous programming where multiple parallel paths can raise exceptions.\n\nInterrupt uses and abuses the `Error.stack` property provided by Google V8 to\ngenerate an elaborate report from `Error.stack` including the `Error` type,\nmessage, context properties, and stack trace along with the error messages and\nstack traces of all the nested errors.\n\nInterrupt's elaborate `Error.stack` is machine readable so you could conceivably\nprocess these stack traces programmatically after gathering them from production\nlogs.\n\nInterrupt can report it's elaborate stack trace de-duped with a count of similar\nexceptions so that when great many parallel operations raise the same you don't\nhave wade through the repetitive stack traces to see if there is anything unique\nabout one of them.\n\nInterrupt endeavours to do all this with a minimum of extra code and code paths\nso you can format exception messages with `sprintf-js`, set properties, specify\nnested expressions the constructor, often as a one-liner. **TODO** Basically\nadvocating one-liners, poorly worded.\n\nThis `README.md` is also a unit test using the\n[Proof](https://github.com/bigeasy/proof) unit test framework. We'll use the\nProof `okay` function to assert out statements in the readme. A Proof unit test\ngenerally looks like this.\n\n```javascript\nrequire('proof')(4, async okay => {\n    okay('always okay')\n    okay(true, 'okay if true')\n    okay(1, 1, 'okay if equal')\n    okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')\n})\n```\n\nYou can run this unit test yourself. The `--async-stack-traces` flag is not\nnecessary on Node.js 14 or above.\n\n```text\ngit clone git@github.com:bigeasy/interrupt.git\ncd interrupt\nnpm install --no-package-lock --no-save\nnode --async-stack-traces test/readme.t.js\n```\n\nThe only way to see the elaborate stack trace output is to run this test at the\ncommand line, so please do so. **TODO** No, we're going to fix that.\n\nInterrupt is targeted for Node.js 12 or greater. Note that we are running with\n`--async-stack-traces` enabled and to enjoy all the features discussed in this\nreadme you need to be running Node.js 14.\n\nThe Interrupt module exports an `Interrupt` constructor.\n\n```javascript\nconst Interrupt = require('interrupt')\n```\n\nAll of the examples in this code are _contrived_, and in practice, I'm\nnever quite this zealous with my use of exceptions or Interrupt.\n\n## Happy Path vs Error Path\n\nThroughout we'll be referring to the happy path and the error path.\n\nThe happy path is the path of code execution where everything goes as\nexpected. It is the code path that gets the most exercise, the path that\nreceives the most robust testing.\n\nThe error path is the path of code excution that is followed when things\ngo sideways. One would hope that the error path is not often executed\nduring normal operation. One would expect the error path to be followed\nas a result unforseen circumstances that might not have been considered\nduring development. Sadly, the error path usually does not receive a lot\nof testing. One should tread lightly on the error path.\n\nInterrupt endevours to be exacting on the happy path and accommodating on\nerror path. It has a lot of assertions on functions that are executed\nduring normal operation and a lot of fallbacks on the functions that are\nexecuted during exception handling.\n\nWhen we speak of the error path in this documenation, we are urging\ncaution and justifing our accommodations. When we speak of the happy path\nin this documentation we are urging rigor and justifying our assertions.\n\n## Errors by Code\n\nErrors in JavaScript have very little context information. The only\nproperties defined by the spec are `name` and `message`.\n\n**TODO** As of this writing, Interrupt is targeted for Node.js and Google\nV8 only, but can probably be ported to other JavaScript engines if\nsomeone would like to recommend a cross-browser development setup. I'm\nopen to porting if someone is interested.\n\nThe `message` is supposed to be human readable and because of this it\ndoesn't serve well as a programmatic indication of error type.\n\n```javascript\nconsole.log('\\n--- message only Errors ---\\n')\n\nconst path = require('path')\nconst fs = require('fs').promises\n\nasync function loadJSONConfiguration (filename) {\n    let json\n    try {\n        json = await fs.readFile(filename, '')\n    } catch (error) {\n        const e = new Error('file unreadable: ' + filename)\n        e.cause = error\n        throw e\n    }\n    let config\n    try {\n        config = JSON.parse(json)\n    } catch (error) {\n        const e = new Error('unable to parse configuration')\n        e.cause = error\n        throw e\n    }\n    if (config == null || typeof config != 'object' || Array.isArray(object)) {\n        throw new Error('JSON must be an object')\n    }\n    if (config.size == null) {\n        throw new Error('memory is a require configuration parameter')\n    }\n    if (config.size == null) {\n        throw new Error('memory configuration parameter must be a number')\n    }\n    return config\n}\n\nlet config\ntry {\n    config = await loadJSONConfiguration(path.join(__dirname, 'missing.txt'))\n} catch (error) {\n    console.log(`${error.stack}\\n`)\n    // If the file doesn't exist, use a default configuration, otherwise\n    // rethrow any configuration exceptions.\n    if (/file unreadable/.test(error.message) && error.cause.code == 'ENOENT') {\n        config = { size: 5 }\n    } else {\n        throw error\n    }\n}\n\nokay(config, { size: 5 }, 'used a default configuration (example)')\n```\n\nOther languages have the ability to catch an exception by type. This\nability to catch by type is where the idea for an exception class for\neach type of error comes from.\n\nJavaScript does not have this ability. Once the exception is caught it\nmust be filtered through an `if`/`else` ladder with `instanceof` to\ndetermine the type of exception. Using entire classes for what is\nessentially a flag is a heavyweight approach. The user now has to import\nthe module's exceptions into the namespace of their application to use\nthem as test conditions. Not only do we have to add this `if`/`else`\nladder, we have to our `require` statements start to look like this.\n\n```javascript\nconst { ConfigParseError, ConfigIOError, loadJSONConfiguration } = require('./config')\n```\n\nThis is so foreign to JavaScript, to use type information directly,\ninstead of using ploymorphism. Kinda feels like we're moving the\ninternals of a dependency into our module to check a flag.\n\nNode.js itself doesn't extend the error class heirarchy by much.  In\nfact, in our code we further test the cause of the I/O error by checking\na `code` property to see if it is a `ENOENT`, the POSIX code for a\nmissing file.\n\nThe Node.js libraries use a base `Error` class (with the exception of the\n`assert` module) and simply set a `code` on the error object. All of the\nerrors eminating from the standard Node.js modules have a `code` property\nand each `code` property has associated documentation.\n\nIf you use codes your module can adhere to this practice.\n\nInterrupt prefers to use codes as well. Interrupt encourages you to\ncreate a set of error codes for your module.\n\nYou can still create an Error object heirarchy using Interrupt, but once\nyou have a set of codes you start to see how they're easier to work with.\n\nYou declare your codes when you create your Interrupt derived class. You\ncan obtain a list of declared codes using the static `codes` property.\n\nIn the example below we declare a `ConfigError` class with an object\nthat maps the error codes to an error message. We can get a list of the\ncodes defined using the `codes` property of the generated class.\n\n```javascript\nokay(Interrupt.prototype instanceof Error, '`Interrupt` is an `Error`')\n\nconst ConfigError = Interrupt.create('ConfigError', {\n    IO_ERROR: 'unable to read config file',\n    PARSE_ERROR: 'unable to parse config file'\n})\n\nconst codes = ConfigError.codes\nokay(codes.sort(), [ 'IO_ERROR', 'PARSE_ERROR' ], 'set of generated error codes')\n\nokay(typeof ConfigError.IO_ERROR, 'symbol', 'constant that maps an error code name to a symbol')\nokay(typeof ConfigError.PARSE_ERROR, 'symbol', 'one for each error code')\n\nokay(ConfigError.prototype instanceof Interrupt, 'generated error is an `Interrupt`')\nokay(ConfigError.prototype instanceof Error, 'generated error is therefore also an `Error`')\n```\n","readmeFilename":"README.md","gitHead":"b1f666d31d5682605ec517b4e957541eb6819363","_id":"interrupt@11.0.0-alpha.24","_nodeVersion":"16.4.2","_npmVersion":"7.18.1","dist":{"integrity":"sha512-3Q8LoSc0op4PDK7osS/+pcbxGRrNsDn7lLf/kUFo+Ful2ZX1pci6EHemTjqAMCSuIRTveAy5t3/0FXCt0yzIzg==","shasum":"d1c6ba87a498b645876f4b4041182f61d51f0c46","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.24.tgz","fileCount":6,"unpackedSize":99142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCQxhCRA9TVsSAnZWagAA6wgQAIcoZdmv5rWGQI5wuzLg\nF1wIpQt2MxaHg8nTHELitoKQZsJYD22qWzxqj2Ty0Xh2DijsDLrFYtYoR0nh\nciAbnv0fViGw0IjMq0CzG0RGoFgV6DZ28pb+2tY+OShhinRm6Lhg5O+fvy/e\niBQdo4Zmft/x7ztfF/ZXHs5k4CVBLnMXXAKqf2bwYw6Ls6Z1sVzkt5wY6h+t\n59yTIpB7K7lKdL4CYxVWsxK4XXl1+NpErzuqavYNCrDpjFpVj7xUWchFGHN+\n2ULS1g2O/7AxVMJNymvR08XR7/n9Ovadiv8B+to4supTVsvEWQvrjSERy4Qs\n+TZz9LnFMAW1wKXnUVi9bYlUFiQgLqO9wfSLW7ZbvuNfA6rsRz4OtXff7jw9\n5euENFlvYJOuNujKt0Q+RvO4CjynV3s8gtlJb9fKTkcEjryX3GaKONuEO0ii\n7NPi9qYHuYF3VzZBParsYt3saLUr2I6IJp4oy9MJ+ivMGC63a5h1H193zx15\nVSYEBeM9USR+u5n7IyHufF2ayuEaT908+j7lSClRDRwLY7fzasdgZj0LRXCT\nR1eNuNyoGHg1cZjKVnW2e2tVN77HNy+J6PpGL/BHMIjaM7jw+HyuCgpnaIZq\nWlBQc9/7virboLw30iQR7tVS+Ug01ylr+MZe0cKk1BMCrN0hyEDkILjRijoE\nq57j\r\n=u68J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzEGYyl2LXvZ19SM+79Xa+NCKs3UQIVglMa2tzO2mHHAiEAj/VS1lMchPoVTnJUMZvYngC11ANEoBqxdsJbF+2E8Dk="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.24_1627982945778_0.8634256807427478"},"_hasShrinkwrap":false},"11.0.0-alpha.25":{"name":"interrupt","version":"11.0.0-alpha.25","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^2.0.0-alpha.4","keyify":"^3.0.0","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^3.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\nInterrupt installs from NPM.\n\n```\nnpm install interrupt\n```\n\nExceptions are nice. I like the concept. I've always done my best to employ them\nin JavaScript and Node.js but it isn't always easy.\n\nInterrupt is a module I created to address the problems with JavaScript's\nlimited exception mechanism, solving the challenges I've encountered over the\nyears that I'm sure you've encountered as well. It is not an elegant solution,\nbut it is a solution none the less.\n\n## Advocacy\n\nInterrupt allows you to get exceptions that have a file name and line number\nfrom your program, instead of a stubby stack trace that points to the wilderness\nof the Node.js source, or [no stack trace at\nall](https://github.com/nodejs/node/issues/30944). It does this with some\nsyntactical struggle, but without the expensive superfluous stack trace\ngeneration of the long stack trace modules.\n\nInterrupt allows you to nest exceptions so you can provide application context\nto system and library exceptions.\n\nInterrupt allows you to cite multiple nested exceptions as the cause of your\ncontextual exception which is necessary if you're doing any sort of parallel\nasynchronous programming where multiple parallel paths can raise exceptions.\n\nInterrupt uses and abuses the `Error.stack` property provided by Google V8 to\ngenerate an elaborate report from `Error.stack` including the `Error` type,\nmessage, context properties, and stack trace along with the error messages and\nstack traces of all the nested errors.\n\nInterrupt's elaborate `Error.stack` is machine readable so you could conceivably\nprocess these stack traces programmatically after gathering them from production\nlogs.\n\nInterrupt can report it's elaborate stack trace de-duped with a count of similar\nexceptions so that when great many parallel operations raise the same you don't\nhave wade through the repetitive stack traces to see if there is anything unique\nabout one of them.\n\nInterrupt endeavours to do all this with a minimum of extra code and code paths\nso you can format exception messages with `sprintf-js`, set properties, specify\nnested expressions the constructor, often as a one-liner. **TODO** Basically\nadvocating one-liners, poorly worded.\n\nThis `README.md` is also a unit test using the\n[Proof](https://github.com/bigeasy/proof) unit test framework. We'll use the\nProof `okay` function to assert out statements in the readme. A Proof unit test\ngenerally looks like this.\n\n```javascript\nrequire('proof')(4, async okay => {\n    okay('always okay')\n    okay(true, 'okay if true')\n    okay(1, 1, 'okay if equal')\n    okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')\n})\n```\n\nYou can run this unit test yourself. The `--async-stack-traces` flag is not\nnecessary on Node.js 14 or above.\n\n```text\ngit clone git@github.com:bigeasy/interrupt.git\ncd interrupt\nnpm install --no-package-lock --no-save\nnode --async-stack-traces test/readme.t.js\n```\n\nThe only way to see the elaborate stack trace output is to run this test at the\ncommand line, so please do so. **TODO** No, we're going to fix that.\n\nInterrupt is targeted for Node.js 12 or greater. Note that we are running with\n`--async-stack-traces` enabled and to enjoy all the features discussed in this\nreadme you need to be running Node.js 14.\n\nThe Interrupt module exports an `Interrupt` constructor.\n\n```javascript\nconst Interrupt = require('interrupt')\n```\n\nAll of the examples in this code are _contrived_, and in practice, I'm\nnever quite this zealous with my use of exceptions or Interrupt.\n\n## Happy Path vs Error Path\n\nThroughout we'll be referring to the happy path and the error path.\n\nThe happy path is the path of code execution where everything goes as\nexpected. It is the code path that gets the most exercise, the path that\nreceives the most robust testing.\n\nThe error path is the path of code excution that is followed when things\ngo sideways. One would hope that the error path is not often executed\nduring normal operation. One would expect the error path to be followed\nas a result unforseen circumstances that might not have been considered\nduring development. Sadly, the error path usually does not receive a lot\nof testing. One should tread lightly on the error path.\n\nInterrupt endevours to be exacting on the happy path and accommodating on\nerror path. It has a lot of assertions on functions that are executed\nduring normal operation and a lot of fallbacks on the functions that are\nexecuted during exception handling.\n\nWhen we speak of the error path in this documenation, we are urging\ncaution and justifing our accommodations. When we speak of the happy path\nin this documentation we are urging rigor and justifying our assertions.\n\n## Errors by Code\n\nErrors in JavaScript have very little context information. The only\nproperties defined by the spec are `name` and `message`.\n\n**TODO** As of this writing, Interrupt is targeted for Node.js and Google\nV8 only, but can probably be ported to other JavaScript engines if\nsomeone would like to recommend a cross-browser development setup. I'm\nopen to porting if someone is interested.\n\nThe `message` is supposed to be human readable and because of this it\ndoesn't serve well as a programmatic indication of error type.\n\n```javascript\nconsole.log('\\n--- message only Errors ---\\n')\n\nconst path = require('path')\nconst fs = require('fs').promises\n\nasync function loadJSONConfiguration (filename) {\n    let json\n    try {\n        json = await fs.readFile(filename, '')\n    } catch (error) {\n        const e = new Error('file unreadable: ' + filename)\n        e.cause = error\n        throw e\n    }\n    let config\n    try {\n        config = JSON.parse(json)\n    } catch (error) {\n        const e = new Error('unable to parse configuration')\n        e.cause = error\n        throw e\n    }\n    if (config == null || typeof config != 'object' || Array.isArray(object)) {\n        throw new Error('JSON must be an object')\n    }\n    if (config.size == null) {\n        throw new Error('memory is a require configuration parameter')\n    }\n    if (config.size == null) {\n        throw new Error('memory configuration parameter must be a number')\n    }\n    return config\n}\n\nlet config\ntry {\n    config = await loadJSONConfiguration(path.join(__dirname, 'missing.txt'))\n} catch (error) {\n    console.log(`${error.stack}\\n`)\n    // If the file doesn't exist, use a default configuration, otherwise\n    // rethrow any configuration exceptions.\n    if (/file unreadable/.test(error.message) && error.cause.code == 'ENOENT') {\n        config = { size: 5 }\n    } else {\n        throw error\n    }\n}\n\nokay(config, { size: 5 }, 'used a default configuration (example)')\n```\n\nOther languages have the ability to catch an exception by type. This\nability to catch by type is where the idea for an exception class for\neach type of error comes from.\n\nJavaScript does not have this ability. Once the exception is caught it\nmust be filtered through an `if`/`else` ladder with `instanceof` to\ndetermine the type of exception. Using entire classes for what is\nessentially a flag is a heavyweight approach. The user now has to import\nthe module's exceptions into the namespace of their application to use\nthem as test conditions. Not only do we have to add this `if`/`else`\nladder, we have to our `require` statements start to look like this.\n\n```javascript\nconst { ConfigParseError, ConfigIOError, loadJSONConfiguration } = require('./config')\n```\n\nThis is so foreign to JavaScript, to use type information directly,\ninstead of using ploymorphism. Kinda feels like we're moving the\ninternals of a dependency into our module to check a flag.\n\nNode.js itself doesn't extend the error class heirarchy by much.  In\nfact, in our code we further test the cause of the I/O error by checking\na `code` property to see if it is a `ENOENT`, the POSIX code for a\nmissing file.\n\nThe Node.js libraries use a base `Error` class (with the exception of the\n`assert` module) and simply set a `code` on the error object. All of the\nerrors eminating from the standard Node.js modules have a `code` property\nand each `code` property has associated documentation.\n\nIf you use codes your module can adhere to this practice.\n\nInterrupt prefers to use codes as well. Interrupt encourages you to\ncreate a set of error codes for your module.\n\nYou can still create an Error object heirarchy using Interrupt, but once\nyou have a set of codes you start to see how they're easier to work with.\n\nYou declare your codes when you create your Interrupt derived class. You\ncan obtain a list of declared codes using the static `codes` property.\n\nIn the example below we declare a `ConfigError` class with an object\nthat maps the error codes to an error message. We can get a list of the\ncodes defined using the `codes` property of the generated class.\n\n```javascript\nokay(Interrupt.prototype instanceof Error, '`Interrupt` is an `Error`')\n\nconst ConfigError = Interrupt.create('ConfigError', {\n    IO_ERROR: 'unable to read config file',\n    PARSE_ERROR: 'unable to parse config file'\n})\n\nconst codes = ConfigError.codes\nokay(codes.sort(), [ 'IO_ERROR', 'PARSE_ERROR' ], 'set of generated error codes')\n\nokay(typeof ConfigError.IO_ERROR, 'symbol', 'constant that maps an error code name to a symbol')\nokay(typeof ConfigError.PARSE_ERROR, 'symbol', 'one for each error code')\n\nokay(ConfigError.prototype instanceof Interrupt, 'generated error is an `Interrupt`')\nokay(ConfigError.prototype instanceof Error, 'generated error is therefore also an `Error`')\n```\n","readmeFilename":"README.md","gitHead":"35b8fd7c51109309bd2d97558f53ca40a5dd8dc0","_id":"interrupt@11.0.0-alpha.25","_nodeVersion":"16.4.2","_npmVersion":"7.18.1","dist":{"integrity":"sha512-OlqW7oLfvWwieHasEl3cBzdFtIq/ObPuw/CIZ3fJBuz4vJzmHRCyBuwXmk0Yu+9vwmLX7uMtQ8pgYql6McrJbQ==","shasum":"068831c57591a29807fbf39a76dbd2c1883088be","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.25.tgz","fileCount":6,"unpackedSize":99142,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG3vXw5Jtk7AIteVXIvAoGhrn+3/jYeh/X8r4PrOPGxlAiEA9FdSAIkxyjhz0CN9oMlznpBX28wTWj5hGHtjyz1NwME="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.25_1632107243221_0.18585262061616104"},"_hasShrinkwrap":false},"11.0.0-alpha.26":{"name":"interrupt","version":"11.0.0-alpha.26","description":"Nested exceptions with elaborate stack traces for Node.js.","keywords":["bluey","error","try","catch"],"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"homepage":"https://github.com/bigeasy/interrupt","bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"dependencies":{"extant":"^2.0.0-alpha.4","keyify":"^3.0.0","sprintf-js":"1.1.2","stacktrace-parser":"0.1.10"},"devDependencies":{"proof":"^9.0.0","semblance":"^3.0.0"},"main":"interrupt","scripts":{"test":"proof test/*.t.js"},"readme":"[![Actions Status](https://github.com/bigeasy/interrupt/workflows/Node%20CI/badge.svg)](https://github.com/bigeasy/interrupt/actions)\n[![codecov](https://codecov.io/gh/bigeasy/interrupt/branch/master/graph/badge.svg)](https://codecov.io/gh/bigeasy/interrupt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nNested exceptions with elaborate stack traces for Node.js.\n\n| What          | Where                                         |\n| --- | --- |\n| Discussion    | https://github.com/bigeasy/interrupt/issues/1 |\n| Documentation | https://bigeasy.github.io/interrupt           |\n| Source        | https://github.com/bigeasy/interrupt          |\n| Issues        | https://github.com/bigeasy/interrupt/issues   |\n| CI            | https://travis-ci.org/bigeasy/interrupt       |\n| Coverage:     | https://codecov.io/gh/bigeasy/interrupt       |\n| License:      | MIT                                           |\n\nInterrupt installs from NPM.\n\n```\nnpm install interrupt\n```\n\nExceptions are nice. I like the concept. I've always done my best to employ them\nin JavaScript and Node.js but it isn't always easy.\n\nInterrupt is a module I created to address the problems with JavaScript's\nlimited exception mechanism, solving the challenges I've encountered over the\nyears that I'm sure you've encountered as well. It is not an elegant solution,\nbut it is a solution none the less.\n\n## Advocacy\n\nInterrupt allows you to get exceptions that have a file name and line number\nfrom your program, instead of a stubby stack trace that points to the wilderness\nof the Node.js source, or [no stack trace at\nall](https://github.com/nodejs/node/issues/30944). It does this with some\nsyntactical struggle, but without the expensive superfluous stack trace\ngeneration of the long stack trace modules.\n\nInterrupt allows you to nest exceptions so you can provide application context\nto system and library exceptions.\n\nInterrupt allows you to cite multiple nested exceptions as the cause of your\ncontextual exception which is necessary if you're doing any sort of parallel\nasynchronous programming where multiple parallel paths can raise exceptions.\n\nInterrupt uses and abuses the `Error.stack` property provided by Google V8 to\ngenerate an elaborate report from `Error.stack` including the `Error` type,\nmessage, context properties, and stack trace along with the error messages and\nstack traces of all the nested errors.\n\nInterrupt's elaborate `Error.stack` is machine readable so you could conceivably\nprocess these stack traces programmatically after gathering them from production\nlogs.\n\nInterrupt can report it's elaborate stack trace de-duped with a count of similar\nexceptions so that when great many parallel operations raise the same you don't\nhave wade through the repetitive stack traces to see if there is anything unique\nabout one of them.\n\nInterrupt endeavours to do all this with a minimum of extra code and code paths\nso you can format exception messages with `sprintf-js`, set properties, specify\nnested expressions the constructor, often as a one-liner. **TODO** Basically\nadvocating one-liners, poorly worded.\n\nThis `README.md` is also a unit test using the\n[Proof](https://github.com/bigeasy/proof) unit test framework. We'll use the\nProof `okay` function to assert out statements in the readme. A Proof unit test\ngenerally looks like this.\n\n```javascript\nrequire('proof')(4, async okay => {\n    okay('always okay')\n    okay(true, 'okay if true')\n    okay(1, 1, 'okay if equal')\n    okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')\n})\n```\n\nYou can run this unit test yourself. The `--async-stack-traces` flag is not\nnecessary on Node.js 14 or above.\n\n```text\ngit clone git@github.com:bigeasy/interrupt.git\ncd interrupt\nnpm install --no-package-lock --no-save\nnode --async-stack-traces test/readme.t.js\n```\n\nThe only way to see the elaborate stack trace output is to run this test at the\ncommand line, so please do so. **TODO** No, we're going to fix that.\n\nInterrupt is targeted for Node.js 12 or greater. Note that we are running with\n`--async-stack-traces` enabled and to enjoy all the features discussed in this\nreadme you need to be running Node.js 14.\n\nThe Interrupt module exports an `Interrupt` constructor.\n\n```javascript\nconst Interrupt = require('interrupt')\n```\n\nAll of the examples in this code are _contrived_, and in practice, I'm\nnever quite this zealous with my use of exceptions or Interrupt.\n\n## Happy Path vs Error Path\n\nThroughout we'll be referring to the happy path and the error path.\n\nThe happy path is the path of code execution where everything goes as\nexpected. It is the code path that gets the most exercise, the path that\nreceives the most robust testing.\n\nThe error path is the path of code excution that is followed when things\ngo sideways. One would hope that the error path is not often executed\nduring normal operation. One would expect the error path to be followed\nas a result unforseen circumstances that might not have been considered\nduring development. Sadly, the error path usually does not receive a lot\nof testing. One should tread lightly on the error path.\n\nInterrupt endevours to be exacting on the happy path and accommodating on\nerror path. It has a lot of assertions on functions that are executed\nduring normal operation and a lot of fallbacks on the functions that are\nexecuted during exception handling.\n\nWhen we speak of the error path in this documenation, we are urging\ncaution and justifing our accommodations. When we speak of the happy path\nin this documentation we are urging rigor and justifying our assertions.\n\n## Errors by Code\n\nErrors in JavaScript have very little context information. The only\nproperties defined by the spec are `name` and `message`.\n\n**TODO** As of this writing, Interrupt is targeted for Node.js and Google\nV8 only, but can probably be ported to other JavaScript engines if\nsomeone would like to recommend a cross-browser development setup. I'm\nopen to porting if someone is interested.\n\nThe `message` is supposed to be human readable and because of this it\ndoesn't serve well as a programmatic indication of error type.\n\n```javascript\nconsole.log('\\n--- message only Errors ---\\n')\n\nconst path = require('path')\nconst fs = require('fs').promises\n\nasync function loadJSONConfiguration (filename) {\n    let json\n    try {\n        json = await fs.readFile(filename, '')\n    } catch (error) {\n        const e = new Error('file unreadable: ' + filename)\n        e.cause = error\n        throw e\n    }\n    let config\n    try {\n        config = JSON.parse(json)\n    } catch (error) {\n        const e = new Error('unable to parse configuration')\n        e.cause = error\n        throw e\n    }\n    if (config == null || typeof config != 'object' || Array.isArray(object)) {\n        throw new Error('JSON must be an object')\n    }\n    if (config.size == null) {\n        throw new Error('memory is a require configuration parameter')\n    }\n    if (config.size == null) {\n        throw new Error('memory configuration parameter must be a number')\n    }\n    return config\n}\n\nlet config\ntry {\n    config = await loadJSONConfiguration(path.join(__dirname, 'missing.txt'))\n} catch (error) {\n    console.log(`${error.stack}\\n`)\n    // If the file doesn't exist, use a default configuration, otherwise\n    // rethrow any configuration exceptions.\n    if (/file unreadable/.test(error.message) && error.cause.code == 'ENOENT') {\n        config = { size: 5 }\n    } else {\n        throw error\n    }\n}\n\nokay(config, { size: 5 }, 'used a default configuration (example)')\n```\n\nOther languages have the ability to catch an exception by type. This\nability to catch by type is where the idea for an exception class for\neach type of error comes from.\n\nJavaScript does not have this ability. Once the exception is caught it\nmust be filtered through an `if`/`else` ladder with `instanceof` to\ndetermine the type of exception. Using entire classes for what is\nessentially a flag is a heavyweight approach. The user now has to import\nthe module's exceptions into the namespace of their application to use\nthem as test conditions. Not only do we have to add this `if`/`else`\nladder, we have to our `require` statements start to look like this.\n\n```javascript\nconst { ConfigParseError, ConfigIOError, loadJSONConfiguration } = require('./config')\n```\n\nThis is so foreign to JavaScript, to use type information directly,\ninstead of using ploymorphism. Kinda feels like we're moving the\ninternals of a dependency into our module to check a flag.\n\nNode.js itself doesn't extend the error class heirarchy by much.  In\nfact, in our code we further test the cause of the I/O error by checking\na `code` property to see if it is a `ENOENT`, the POSIX code for a\nmissing file.\n\nThe Node.js libraries use a base `Error` class (with the exception of the\n`assert` module) and simply set a `code` on the error object. All of the\nerrors eminating from the standard Node.js modules have a `code` property\nand each `code` property has associated documentation.\n\nIf you use codes your module can adhere to this practice.\n\nInterrupt prefers to use codes as well. Interrupt encourages you to\ncreate a set of error codes for your module.\n\nYou can still create an Error object heirarchy using Interrupt, but once\nyou have a set of codes you start to see how they're easier to work with.\n\nYou declare your codes when you create your Interrupt derived class. You\ncan obtain a list of declared codes using the static `codes` property.\n\nIn the example below we declare a `ConfigError` class with an object\nthat maps the error codes to an error message. We can get a list of the\ncodes defined using the `codes` property of the generated class.\n\n```javascript\nokay(Interrupt.prototype instanceof Error, '`Interrupt` is an `Error`')\n\nconst ConfigError = Interrupt.create('ConfigError', {\n    IO_ERROR: 'unable to read config file',\n    PARSE_ERROR: 'unable to parse config file'\n})\n\nconst codes = ConfigError.codes\nokay(codes.sort(), [ 'IO_ERROR', 'PARSE_ERROR' ], 'set of generated error codes')\n\nokay(typeof ConfigError.IO_ERROR, 'symbol', 'constant that maps an error code name to a symbol')\nokay(typeof ConfigError.PARSE_ERROR, 'symbol', 'one for each error code')\n\nokay(ConfigError.prototype instanceof Interrupt, 'generated error is an `Interrupt`')\nokay(ConfigError.prototype instanceof Error, 'generated error is therefore also an `Error`')\n```\n","readmeFilename":"README.md","gitHead":"b1f9f5425d704d26afca926366a170f87838bfb4","_id":"interrupt@11.0.0-alpha.26","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-VJeui7YW9WIccQgLOr18DsvEaGGiz1ZkDfJn5szvqjrE58GaRzpaIG68innyDPD3QbS1P39+d7N7m1SgyvXpNQ==","shasum":"68d77446cb16d4d9fd855f2e5ed0cbbc26f0d2ff","tarball":"https://registry.npmjs.org/interrupt/-/interrupt-11.0.0-alpha.26.tgz","fileCount":6,"unpackedSize":99142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiALyICRA9TVsSAnZWagAAihAP+wROJrf4dBApPzKWIzR/\nlEO0VhEr27C4Mwjkj7TKsmB6AVJr0XjU7U+kSZOHHOD2aliAnVPUA00GW2Tm\nhr6fa/K+35F6or72avJ9LKkBiuM1Yjh7vB4NTJ3IblZwqqVU2sQqPK2TuuA8\n+a+WhnOvVVI5psbAKr4uydZpjKckrXOc6DG6INoT3ueDWJmrK86+eyZMeydT\nODfWElUMvaiMb2ecmctPP0KztaR6Tr/HN46C83WEjfRd4r+yjeMaKmd1CUVc\nVpH8hCbKw6WWFmDvWRdtskcZycuzlc8/ERT+B51LZLLY3Zw1U29WMSlMNcgU\nQCInXkzcanJyZEwtdh1mZYyRcYtIDqlJhNzIJ8C1X7Sw3BC5+KQcd10u+I/Y\nDMLTq7AxXGP3H9MUNa9I9y5k21Ab36oPmc3AU/D85ehCRfWOLi+EHeOy2zRt\nrxnbEGmJcAqVMaKyXWM7BNxi9Pb1X8pYDrLXKbJi7MoyOoTtPj7d27TKKdKh\n/6uxHpPVeZLOnL9huE7UXOtA2mTWDRWYu8wQH/nHzv47aaWzbvfjNHzxTzEw\nZWoHp9ZzN4VJzwIeTqlLrvxvwxvz1Q8SQUVSEH0FGzg7dpNIDYqj3KRBsTNl\njnGh9xLuqylFth7c8IaFRyBWgiVjGvN87RL/m4AuMKNknkvJa2ITl3IvTVpy\n6giF\r\n=n/6r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID5Vxg6phO5gc3gZkZSeN/tjXy0IQVeFjtdbc8AReRR/AiBnVxBg0EqkM8VWG/4j/YW3FJQpeDh8wMOcEotG2lM84g=="}]},"_npmUser":{"name":"bigeasy","email":"alan@prettyrobots.com"},"directories":{},"maintainers":[{"name":"bigeasy","email":"alan@prettyrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interrupt_11.0.0-alpha.26_1644215432207_0.3970646746921771"},"_hasShrinkwrap":false}},"homepage":"https://github.com/bigeasy/interrupt","keywords":["bluey","error","try","catch"],"repository":{"type":"git","url":"git+https://github.com/bigeasy/interrupt.git"},"author":{"name":"Alan Gutierrez","email":"alan@prettyrobots.com"},"bugs":{"url":"https://github.com/bigeasy/interrupt/issues"},"license":"MIT","readmeFilename":""}