6 ms·
i think there is a distinct difference between an exception, and a recoverable error. Result is not intended to be used for exceptions, but rather recoverable
by holtalanm 7y ago
i think there is a distinct difference between an exception, and a recoverable error.
Result is not intended to be used for exceptions, but rather recoverable errors. There are a number of situations where I have used Result to recover from an exception that was expected, but it would be folly to try to handle all error paths (especially with runtime errors).
I think the author is trying to convey the point that we shouldn't use Result as a catch-all, but rather as a means of conveying possible known error paths for a function. There will always be the possible unknown error paths, which are handled by the runtime's exception handling/reporting.