Is there a function somewhere to convert from an exception-based flow (eg. Requests from Ktor) to an Either-based flow?
I guess there's always the option to try-catch and create the Either myself, but from what you guys I've done so far, there's probably some nice syntax sugar ^^
p
pakoito
05/27/2020, 4:59 PM
Either.catch
and
handleErrorWith
😄
😍 1
pakoito
05/27/2020, 4:59 PM
Either.catch used to be non-suspend. As exceptions are side-effects, we put it inside suspend. It was controversial, you can always reproduce the function without it as you say.