Improves code formatting in ResolveSpaceInfoTask

This commit is contained in:
ericdecanini 2022-03-10 21:41:17 +01:00
parent a5af4783cc
commit 7226864cc9
1 changed files with 6 additions and 8 deletions

View File

@ -38,16 +38,14 @@ internal class DefaultResolveSpaceInfoTask @Inject constructor(
) : ResolveSpaceInfoTask { ) : ResolveSpaceInfoTask {
override suspend fun execute(params: ResolveSpaceInfoTask.Params) = executeRequest(globalErrorReceiver) { 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 { private suspend fun getSpaceHierarchy(params: ResolveSpaceInfoTask.Params) =
getStableSpaceHierarchy(params)
} catch (e: HttpException) {
getUnstableSpaceHierarchy(params)
}
private suspend fun getStableSpaceHierarchy(params: ResolveSpaceInfoTask.Params) =
spaceApi.getSpaceHierarchy( spaceApi.getSpaceHierarchy(
spaceId = params.spaceId, spaceId = params.spaceId,
suggestedOnly = params.suggestedOnly, suggestedOnly = params.suggestedOnly,