3 ms·
But then are doing the bubbling manually and, on top of that, you pollute the return type of all the methods along the way. Suddenly, callers of such a function
by incepted 11y ago
But then are doing the bubbling manually and, on top of that, you pollute the return type of all the methods along the way. Suddenly, callers of such a function that just needed an Int now have to deal with an Either<Error, Int> and all the boiler plate that comes with it.
Exceptions fix that by not bothering any of these users because the return type of the methods in-between is not affected.