4 ms·
Totally agree. In cases where the error type matters, I like to return rather than throw the error. type Success = string type Result = Success | BadI
by rattray 6y ago
Totally agree.
In cases where the error type matters, I like to return rather than throw the error.
type Success = string
type Result = Success | BadInputError | NotFoundError | IncalculableError
const foo = (input: I): Result => {
//...
}