From 7226864cc954929cfc2bc6f5e932a9171702a8db Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Thu, 10 Mar 2022 21:41:17 +0100 Subject: [PATCH] Improves code formatting in ResolveSpaceInfoTask --- .../internal/session/space/ResolveSpaceInfoTask.kt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/ResolveSpaceInfoTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/ResolveSpaceInfoTask.kt index 735d0904d9..d59ca06c2c 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/ResolveSpaceInfoTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/space/ResolveSpaceInfoTask.kt @@ -38,16 +38,14 @@ internal class DefaultResolveSpaceInfoTask @Inject constructor( ) : ResolveSpaceInfoTask { override suspend fun execute(params: ResolveSpaceInfoTask.Params) = executeRequest(globalErrorReceiver) { - getSpaceHierarchy(params) + try { + getSpaceHierarchy(params) + } catch (e: HttpException) { + getUnstableSpaceHierarchy(params) + } } - private suspend fun getSpaceHierarchy(params: ResolveSpaceInfoTask.Params) = try { - getStableSpaceHierarchy(params) - } catch (e: HttpException) { - getUnstableSpaceHierarchy(params) - } - - private suspend fun getStableSpaceHierarchy(params: ResolveSpaceInfoTask.Params) = + private suspend fun getSpaceHierarchy(params: ResolveSpaceInfoTask.Params) = spaceApi.getSpaceHierarchy( spaceId = params.spaceId, suggestedOnly = params.suggestedOnly,