-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
507 additions
and
162 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
android/app/src/main/java/com/happy/friendogly/data/error/DataErrorHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.happy.friendogly.data.error | ||
|
||
import com.happy.friendogly.data.mapper.toDomain | ||
import com.happy.friendogly.domain.DomainResult | ||
import com.happy.friendogly.domain.error.DataError | ||
import java.net.ConnectException | ||
import java.net.UnknownHostException | ||
|
||
fun <T> Throwable.toDomainError(): DomainResult.Error<T, DataError.Network> { | ||
return when (this) { | ||
is ApiExceptionDto -> DomainResult.Error(this.error.data.errorCode.toDomain()) | ||
is ConnectException, is UnknownHostException -> DomainResult.Error(DataError.Network.NO_INTERNET) | ||
else -> DomainResult.Error(DataError.Network.SERVER_ERROR) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
android/app/src/main/java/com/happy/friendogly/domain/repository/MyClubRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
package com.happy.friendogly.domain.repository | ||
|
||
import com.happy.friendogly.domain.DomainResult | ||
import com.happy.friendogly.domain.error.DataError | ||
import com.happy.friendogly.domain.model.Club | ||
|
||
interface MyClubRepository { | ||
suspend fun getMyClubs(): Result<List<Club>> | ||
suspend fun getMyClubs(): DomainResult<List<Club>, DataError.Network> | ||
|
||
suspend fun getMyHeadClubs(): Result<List<Club>> | ||
suspend fun getMyHeadClubs(): DomainResult<List<Club>, DataError.Network> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.