DEV Community

Discussion on: Return your errors instead of throwing them in typescript

Collapse
 
aidasbaublys profile image
Aidas Baublys • Edited

Why do you use separate try catch blocks instead of one big one in all the examples? With one big one you do not need to create extra functionality, just catch any error and handle it from there. You still use try catch with, imo, needless abstraction and complexity.

Seems to me like pointless optimization and refactoring that makes it easier only to the person who created it (maybe), while any other developer will need to re-learn a widely accepted and working pattern to only discover it being used under the hood:D