DEV Community

Discussion on: Say goodbye Trycatch Hell

Collapse
 
ivanhoe011 profile image
Ivan Dilber

Completely pointless refactor exercise IMHO, as now instead of try/catch-ing you need to check each time if a function returned an error or not.

When an exception is thrown it will jump out of all blocks, so there's no need to catch it at the same level. You can set just a single try/catch block on the parent (or even higher) scope to catch all of them.