DEV Community

Discussion on: Type-Safe Error Handling In TypeScript

Collapse
 
bicatu profile image
Mario Bittencourt

Thank you for sharing. I liked the article although I have to process it further as it suggests that we should never throw an exception, which is quite strong :)

One thing that maybe is semantics (or not) is that in other languages we explicitly use the term exception to indicate that what happened was an exceptional situation(error). Anyone using Exceptions as a control follow in the same way of an if/else is already missing the mark.

So, saving to a db and getting a timeout is an exception while searching for something and not finding not.