Andy McGhie
07/04/2022, 11:31 PMephemient
07/04/2022, 11:35 PMresult.recoverCatching { exception ->
throw SomeOtherException(exception)
}
Andy McGhie
07/04/2022, 11:36 PMephemient
07/04/2022, 11:49 PMSomeOtherException
is constructed, so you'll have that cost even without the throw
.result.fold(onSuccess = { Result.success(it) }, onFailure = { Result.failure(transform(it)) })
instead of your originalAndy McGhie
07/04/2022, 11:58 PMfold
method in our code, was just hoping for a slightly cleaner/more elegant solution