Skip to content

Commit

Permalink
Display DataSourceException instead of no internet error
Browse files Browse the repository at this point in the history
  • Loading branch information
StaehliJ committed Feb 23, 2024
1 parent 283eedf commit 9418904
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.content.Context
import android.util.Pair
import androidx.media3.common.ErrorMessageProvider
import androidx.media3.common.PlaybackException
import androidx.media3.datasource.DataSourceException
import ch.srgssr.pillarbox.core.business.exception.BlockReasonException
import ch.srgssr.pillarbox.core.business.exception.DataParsingException
import ch.srgssr.pillarbox.core.business.exception.ResourceNotFoundException
Expand Down Expand Up @@ -37,6 +38,10 @@ class SRGErrorMessageProvider(private val context: Context) : ErrorMessageProvid
Pair.create(0, cause.message)
}

is DataSourceException -> {
Pair.create(cause.reason, cause.message)
}

is IOException -> {
Pair.create(0, context.getString(R.string.NoInternet))
}
Expand Down

0 comments on commit 9418904

Please sign in to comment.