Open dominic-simplan opened 2 years ago
I second that. Sometimes I just need to return the value if isOk()
is fulfilled and to handle the error otherwise. match()
etc. is no use here.
const result = foo()
if (result.isOk()) {
return result.value
}
if (result.error instance of MyError) {
// handle errors
} else if ...
I personally don't have the bandwidth to fix this - PRs are always welcome!
I think I can make a PR with that. Is this repository still maintaining?
Shouldn't it be allowed to handle errors with an if/else block and the isOk/isErr functions? E.g. these should now throw an error: