-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from YAPP-Github/feature/tgyuu/PC-588
- Loading branch information
Showing
17 changed files
with
135 additions
and
11 deletions.
There are no files selected for viewing
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/build | ||
/build | ||
google-services.json |
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
11 changes: 11 additions & 0 deletions
11
core/data/src/main/java/com/puzzle/data/repository/ErrorRepositoryImpl.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,11 @@ | ||
package com.puzzle.data.repository | ||
|
||
import com.puzzle.domain.repository.ErrorRepository | ||
import com.puzzle.network.source.error.ErrorDataSource | ||
import javax.inject.Inject | ||
|
||
class ErrorRepositoryImpl @Inject constructor( | ||
private val errorDataSource: ErrorDataSource, | ||
) : ErrorRepository { | ||
override suspend fun logError(exception: Throwable) = errorDataSource.logError(exception) | ||
} |
10 changes: 7 additions & 3 deletions
10
core/domain/src/main/java/com/puzzle/domain/model/error/ErrorHelper.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,16 +1,20 @@ | ||
package com.puzzle.domain.model.error | ||
|
||
import com.puzzle.domain.repository.ErrorRepository | ||
import kotlinx.coroutines.channels.Channel | ||
import kotlinx.coroutines.flow.receiveAsFlow | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
@Singleton | ||
class ErrorHelper @Inject constructor() { | ||
class ErrorHelper @Inject constructor( | ||
private val errorRepository: ErrorRepository, | ||
) { | ||
private val _errorEvent = Channel<Throwable>(DEFAULT_BUFFER_SIZE) | ||
val errorEvent = _errorEvent.receiveAsFlow() | ||
|
||
fun sendError(error: Throwable) { | ||
_errorEvent.trySend(error) | ||
suspend fun sendError(error: Throwable) { | ||
_errorEvent.send(error) | ||
errorRepository.logError(error) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
core/domain/src/main/java/com/puzzle/domain/repository/ErrorRepository.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,5 @@ | ||
package com.puzzle.domain.repository | ||
|
||
interface ErrorRepository { | ||
suspend fun logError(exception: Throwable) | ||
} |
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
10 changes: 10 additions & 0 deletions
10
core/network/src/main/java/com/puzzle/network/source/error/DebugErrorDataSourceImpl.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,10 @@ | ||
package com.puzzle.network.source.error | ||
|
||
import android.util.Log | ||
import javax.inject.Inject | ||
|
||
class DebugErrorDataSourceImpl @Inject constructor() : ErrorDataSource { | ||
override suspend fun logError(exception: Throwable) { | ||
Log.e("DebugErrorDataSource", exception.stackTraceToString()) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
core/network/src/main/java/com/puzzle/network/source/error/ErrorDataSource.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,5 @@ | ||
package com.puzzle.network.source.error | ||
|
||
interface ErrorDataSource { | ||
suspend fun logError(exception: Throwable) | ||
} |
12 changes: 12 additions & 0 deletions
12
core/network/src/main/java/com/puzzle/network/source/error/ErrorDataSourceImpl.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,12 @@ | ||
package com.puzzle.network.source.error | ||
|
||
import com.google.firebase.crashlytics.FirebaseCrashlytics | ||
import javax.inject.Inject | ||
|
||
class ErrorDataSourceImpl @Inject constructor( | ||
private val firebaseCrashlytics: FirebaseCrashlytics, | ||
) : ErrorDataSource { | ||
override suspend fun logError(exception: Throwable) { | ||
firebaseCrashlytics.recordException(exception) | ||
} | ||
} |
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