mng
04/15/2021, 3:25 PMfun getMyResult(): Result<TheThing>{
var myResult = Result.success(TheThing())
return myRresult.mapCatching {
throw IllegalArgumentException("")
}
}
My expectation here is that the getMyResult()
function will return a Failure Result that wraps the IllegalArgumentException. However, what is happening is that my application just crashes. Am I misunderstanding how mapCatching
works?Matteo Mirk
04/15/2021, 3:34 PMDaniele Andreoli
04/15/2021, 3:34 PMreturn myRresult..
? 🤔mng
04/15/2021, 3:46 PMmng
04/15/2021, 3:46 PMelizarov
04/15/2021, 5:53 PMmng
04/15/2021, 6:54 PMmapCatching
though i’m not sure if that should change anythingmng
04/15/2021, 6:57 PMmng
04/15/2021, 6:57 PMmapCatching
mng
04/17/2021, 4:07 AMgetOrThrow
at one of the call sites for this particular function 🤦♂️ . What’s bizarre though is that the logs point me to mapCatching
instead of the getOrThrow
location