Sergio Crespo Toubes
12/02/2021, 10:45 AMprivate val myLocationsChannel = Channel<MyLocation>(Channel.BUFFERED)
val myLocationsFlow = myLocationsChannel.receiveAsFlow()
How can i send an error to the channel? For example when i havent location permissions.
ThanksJoffrey
12/02/2021, 10:48 AMchannel.close(cause)
). If you want errors that can be recovered and allow you to continue with regular events, you'll need to materialize them (represent them as part of the channel item type). One way to do this neatly is to use a sealed class representing either location events or errors.Sergio Crespo Toubes
12/02/2021, 10:49 AMhfhbd
12/02/2021, 11:23 AMnull
too.Sergio Crespo Toubes
12/02/2021, 11:24 AM