kenkyee
11/16/2018, 1:08 AMgildor
11/16/2018, 2:18 AMkenkyee
11/16/2018, 3:08 AMgildor
11/16/2018, 4:11 AMcatch only the specific type of exception...not add a catchallSo, why cannot you do this for Coroutines?
though in Rx, you subscribe and use the 2nd param for the error handlerWhich is exactly what
catch (exception: Exception)
is, catch all the Throwables, I don’t see any difference. So or use this approach and disable this check, or use specific exception typeelizarov
11/16/2018, 7:03 AMrunCatching { ... }.onFailure { ... }
:troll:kenkyee
11/16/2018, 11:38 AMgildor
11/16/2018, 11:52 AMconsistent coding guidrline that’s similar to the Rx techniqueThis is exactly as
catch (exception: Exception)
, Rx just doesn’t have easy way manage it (as coroutines) so Rx practice: catch all the exceptions
Catching broad exceptions is generally bad practiceWhich is true, but this is true for coroutines or for any other code, there is no difference I don’t think that coroutines should force some specific exception handling practice, just because you can use any approach that you prefer for your other code
kenkyee
11/16/2018, 2:41 PM