In crashlytics I'm seeing bunch of caught exceptio...
# coroutines
u
In crashlytics I'm seeing bunch of caught exceptions like this
Copy code
Non-fatal Exception: kotlinx.coroutines.flow.internal.ChildCancelledException: Child of the scoped flow was cancelled

Non-fatal Exception: kotlinx.coroutines.JobCancellationException: Job was cancelled
and no stacktrace; are there supposed to be ignored?
l
You're likely catching all
Exception
or `Throwable`s in a suspending function.
u
yes, to map it into a Either monad thing
l
You should ignore
CancellationException
subclasses.
u
Btw I noticed this during development in
flatMapLatest
mostly
you're saying it's natural?
m
In order for Coroutines to properly cancel,
CancellationException
must not be swallowed.
It needs to be thrown.
u
its just logged,
.onCompletion { t -> if (t != null) log(t) }
thanks for you help!