top | item 44779699 (no title) serguzest | 7 months ago One thing you should add to section 10 is encouraging people to pass `cause` option while throwing new Error instances. For examplenew Error("something bad happened", {cause:innerException}) discuss order hn newest seniorsassycat|7 months ago It's wild that that's not what the section is about. Extending error is not new at-all. serguzest|7 months ago Most people (including the author apparently) don't know they can chain errors with cause option in-built way in node and in browser. It is not just arbitrary extending and it is relatively a new thing. https://nodejs.org/api/errors.html#errorcause load replies (1) upcoming-sesame|7 months ago Cool didn't know about this
seniorsassycat|7 months ago It's wild that that's not what the section is about. Extending error is not new at-all. serguzest|7 months ago Most people (including the author apparently) don't know they can chain errors with cause option in-built way in node and in browser. It is not just arbitrary extending and it is relatively a new thing. https://nodejs.org/api/errors.html#errorcause load replies (1)
serguzest|7 months ago Most people (including the author apparently) don't know they can chain errors with cause option in-built way in node and in browser. It is not just arbitrary extending and it is relatively a new thing. https://nodejs.org/api/errors.html#errorcause load replies (1)
seniorsassycat|7 months ago
serguzest|7 months ago
upcoming-sesame|7 months ago