4 ms·
The part you might be missing is that you're explicitly told "this function returns a value OR and error. You must handle error cases with this function". With
by jecxjo 8y ago
The part you might be missing is that you're explicitly told "this function returns a value OR and error. You must handle error cases with this function". With the try/catch paradigm you never know from the function definition if that is the case.
You also know what type the error will be. No need to derive a new class from `Error` and add custom functions to extract the data from your failure case, just pass the data along.