mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Log more errors.
This commit is contained in:
+7
-1
@@ -38,7 +38,9 @@ internal class CoilMediaFetcher(
|
|||||||
private val options: Options
|
private val options: Options
|
||||||
) : Fetcher {
|
) : Fetcher {
|
||||||
override suspend fun fetch(): FetchResult? {
|
override suspend fun fetch(): FetchResult? {
|
||||||
if (mediaData?.source == null) return null
|
if (mediaData?.source == null) return null.also {
|
||||||
|
Timber.e("MediaData source is null")
|
||||||
|
}
|
||||||
return when (mediaData.kind) {
|
return when (mediaData.kind) {
|
||||||
is MediaRequestData.Kind.Content -> fetchContent(mediaData.source, options)
|
is MediaRequestData.Kind.Content -> fetchContent(mediaData.source, options)
|
||||||
is MediaRequestData.Kind.Thumbnail -> fetchThumbnail(mediaData.source, mediaData.kind, options)
|
is MediaRequestData.Kind.Thumbnail -> fetchThumbnail(mediaData.source, mediaData.kind, options)
|
||||||
@@ -72,6 +74,8 @@ internal class CoilMediaFetcher(
|
|||||||
source = mediaSource,
|
source = mediaSource,
|
||||||
).map { byteArray ->
|
).map { byteArray ->
|
||||||
byteArray.asSourceResult(options)
|
byteArray.asSourceResult(options)
|
||||||
|
}.onFailure {
|
||||||
|
Timber.e(it)
|
||||||
}.getOrNull()
|
}.getOrNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +86,8 @@ internal class CoilMediaFetcher(
|
|||||||
height = scalingFunction(kind.height.toFloat()).roundToLong(),
|
height = scalingFunction(kind.height.toFloat()).roundToLong(),
|
||||||
).map { byteArray ->
|
).map { byteArray ->
|
||||||
byteArray.asSourceResult(options)
|
byteArray.asSourceResult(options)
|
||||||
|
}.onFailure {
|
||||||
|
Timber.e(it)
|
||||||
}.getOrNull()
|
}.getOrNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user