4 ms·
“Exceptions” are just a name we give to a particular type of flow control and syntactic sugar. In this case the syntactic sugar helps deal with passing data ac
by zaroth 4y ago
“Exceptions” are just a name we give to a particular type of flow control and syntactic sugar.
In this case the syntactic sugar helps deal with passing data across function boundaries and up the stack in a way that can make the code more readable.
Every function could handle returning its own error states, and then higher level functions could aggregate and check and return the error states of every function it calls… or you might find it saves a massive amount of boilerplate to just use try/catch!