Skip to content

Commit 420ed4b

Browse files
committed
[BOOK-382] chore: detekt TooGenericExceptionCaught lint 옵션 비활성화
try catch 구문을 쓰면 필히 붙혀야 하는 구조임
1 parent 8877838 commit 420ed4b

File tree

8 files changed

+5
-12
lines changed

8 files changed

+5
-12
lines changed

core/common/src/main/kotlin/com/ninecraft/booket/core/common/extensions/Context.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import androidx.core.content.FileProvider
1616
import com.orhanobut.logger.Logger
1717
import java.io.File
1818

19-
@Suppress("TooGenericExceptionCaught")
2019
fun Context.externalShareForBitmap(bitmap: ImageBitmap) {
2120
try {
2221
val file = File(bitmap.saveToDisk(this))
@@ -31,7 +30,6 @@ fun Context.externalShareForBitmap(bitmap: ImageBitmap) {
3130
}
3231
}
3332

34-
@Suppress("TooGenericExceptionCaught")
3533
fun Context.saveImageToGallery(bitmap: ImageBitmap) {
3634
try {
3735
val fileName = "reed_record_${System.currentTimeMillis()}.png"

core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/HandleException.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ fun postErrorDialog(
9393
ErrorEventHelper.sendError(event = ErrorEvent.ShowDialog(spec))
9494
}
9595

96-
@Suppress("TooGenericExceptionCaught")
9796
private fun HttpException.parseErrorMessage(): String? {
9897
return try {
9998
val errorBody = response()?.errorBody()?.string()

core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/RunSuspendCatching.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import kotlin.contracts.ExperimentalContracts
1414
*/
1515

1616
@OptIn(ExperimentalContracts::class)
17-
@Suppress("WRONG_INVOCATION_KIND", "TooGenericExceptionCaught")
17+
@Suppress("WRONG_INVOCATION_KIND")
1818
inline fun <T> runSuspendCatching(block: () -> T): Result<T> {
1919
// 계약(contract): 컴파일러에게 'block' 람다의 실행 시점과 횟수를 명시적으로 알림
2020
// 'callsInPlace'와 'EXACTLY_ONCE'는 'block'이 이 함수 내에서 즉시, 그리고 정확히 한 번만 실행됨을 보장

core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultBookRecentSearchDataSource.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import javax.inject.Inject
1717
class DefaultBookRecentSearchDataSource @Inject constructor(
1818
@BookRecentSearchDataStore private val dataStore: DataStore<Preferences>,
1919
) : BookRecentSearchDataSource {
20-
@Suppress("TooGenericExceptionCaught")
2120
override val recentSearches: Flow<List<String>> = dataStore.data
2221
.handleIOException()
2322
.map { prefs ->
@@ -34,7 +33,6 @@ class DefaultBookRecentSearchDataSource @Inject constructor(
3433
} ?: emptyList()
3534
}
3635

37-
@Suppress("TooGenericExceptionCaught")
3836
override suspend fun addRecentSearch(query: String) {
3937
if (query.isBlank()) return
4038

@@ -66,7 +64,6 @@ class DefaultBookRecentSearchDataSource @Inject constructor(
6664
}
6765
}
6866

69-
@Suppress("TooGenericExceptionCaught")
7067
override suspend fun deleteRecentSearch(query: String) {
7168
dataStore.edit { prefs ->
7269
val currentSearches = prefs[BOOK_RECENT_SEARCHES]?.let { jsonString ->

core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLibraryRecentSearchDataSource.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import javax.inject.Inject
1717
class DefaultLibraryRecentSearchDataSource @Inject constructor(
1818
@LibraryRecentSearchDataStore private val dataStore: DataStore<Preferences>,
1919
) : LibraryRecentSearchDataSource {
20-
@Suppress("TooGenericExceptionCaught")
2120
override val recentSearches: Flow<List<String>> = dataStore.data
2221
.handleIOException()
2322
.map { prefs ->
@@ -34,7 +33,6 @@ class DefaultLibraryRecentSearchDataSource @Inject constructor(
3433
} ?: emptyList()
3534
}
3635

37-
@Suppress("TooGenericExceptionCaught")
3836
override suspend fun addRecentSearch(query: String) {
3937
if (query.isBlank()) return
4038

@@ -66,7 +64,6 @@ class DefaultLibraryRecentSearchDataSource @Inject constructor(
6664
}
6765
}
6866

69-
@Suppress("TooGenericExceptionCaught")
7067
override suspend fun deleteRecentSearch(query: String) {
7168
dataStore.edit { prefs ->
7269
val currentSearches = prefs[LIBRARY_RECENT_SEARCHES]?.let { jsonString ->

core/network/src/main/kotlin/com/ninecraft/booket/core/network/TokenAuthenticator.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import okhttp3.Route
1212
import javax.inject.Inject
1313
import javax.inject.Provider
1414

15-
@Suppress("TooGenericExceptionCaught")
1615
class TokenAuthenticator @Inject constructor(
1716
private val tokenDataSource: TokenDataSource,
1817
private val serviceProvider: Provider<ReedService>,

detekt-config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ style:
6868
MaxLineLength:
6969
active: false
7070

71+
exceptions:
72+
TooGenericExceptionCaught:
73+
active: false
74+
7175
naming:
7276
TopLevelPropertyNaming:
7377
constantPattern: '[A-Z][A-Za-z0-9_]*'

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ class BookDetailPresenter @AssistedInject constructor(
8787
var isBookDeleteDialogVisible by rememberRetained { mutableStateOf(false) }
8888
var sideEffect by rememberRetained { mutableStateOf<BookDetailSideEffect?>(null) }
8989

90-
@Suppress("TooGenericExceptionCaught")
9190
fun initialLoad() {
9291
uiState = UiState.Loading
9392

0 commit comments

Comments
 (0)