mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
Merge 2 mapCatchingExceptions into a single one.
This commit is contained in:
+8
-4
@@ -29,8 +29,10 @@ class DefaultSessionWellknownRetriever @Inject constructor(
|
|||||||
val url = "https://$domain/.well-known/matrix/client"
|
val url = "https://$domain/.well-known/matrix/client"
|
||||||
return matrixClient
|
return matrixClient
|
||||||
.getUrl(url)
|
.getUrl(url)
|
||||||
.mapCatchingExceptions { String(it) }
|
.mapCatchingExceptions {
|
||||||
.mapCatchingExceptions { parser.decodeFromString(InternalWellKnown.serializer(), it) }
|
val data = String(it)
|
||||||
|
parser.decodeFromString(InternalWellKnown.serializer(), data)
|
||||||
|
}
|
||||||
.onFailure { Timber.e(it, "Failed to retrieve .well-known from $domain") }
|
.onFailure { Timber.e(it, "Failed to retrieve .well-known from $domain") }
|
||||||
.map { it.map() }
|
.map { it.map() }
|
||||||
.getOrNull()
|
.getOrNull()
|
||||||
@@ -40,8 +42,10 @@ class DefaultSessionWellknownRetriever @Inject constructor(
|
|||||||
val url = "https://$domain/.well-known/element/element.json"
|
val url = "https://$domain/.well-known/element/element.json"
|
||||||
return matrixClient
|
return matrixClient
|
||||||
.getUrl(url)
|
.getUrl(url)
|
||||||
.mapCatchingExceptions { String(it) }
|
.mapCatchingExceptions {
|
||||||
.mapCatchingExceptions { parser.decodeFromString(InternalElementWellKnown.serializer(), it) }
|
val data = String(it)
|
||||||
|
parser.decodeFromString(InternalElementWellKnown.serializer(), data)
|
||||||
|
}
|
||||||
.onFailure { Timber.e(it, "Failed to retrieve Element .well-known from $domain") }
|
.onFailure { Timber.e(it, "Failed to retrieve Element .well-known from $domain") }
|
||||||
.map { it.map() }
|
.map { it.map() }
|
||||||
.getOrNull()
|
.getOrNull()
|
||||||
|
|||||||
Reference in New Issue
Block a user