Skip to content

Commit 4eb64ef

Browse files
Fix linter errors: remove printStackTrace and fix import ordering
Co-authored-by: abdallahmehiz <54363735+abdallahmehiz@users.noreply.github.com>
1 parent e0494be commit 4eb64ef

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

composeApp/src/commonMain/kotlin/utils/FileStorageManager.kt

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class FileStorageManager(
2222
try {
2323
fileSystem.createDirectories(profilePicturesDir)
2424
fileSystem.createDirectories(universityLogosDir)
25-
} catch (e: Exception) {
26-
e.printStackTrace()
25+
} catch (_: Exception) {
26+
// Directory creation failed, operations will handle this gracefully
2727
}
2828
}
2929

@@ -40,8 +40,7 @@ class FileStorageManager(
4040
}
4141

4242
filePath.toString()
43-
} catch (e: Exception) {
44-
e.printStackTrace()
43+
} catch (_: Exception) {
4544
null
4645
}
4746
}
@@ -59,8 +58,7 @@ class FileStorageManager(
5958
}
6059

6160
filePath.toString()
62-
} catch (e: Exception) {
63-
e.printStackTrace()
61+
} catch (_: Exception) {
6462
null
6563
}
6664
}
@@ -78,8 +76,7 @@ class FileStorageManager(
7876
} else {
7977
null
8078
}
81-
} catch (e: Exception) {
82-
e.printStackTrace()
79+
} catch (_: Exception) {
8380
null
8481
}
8582
}
@@ -96,8 +93,7 @@ class FileStorageManager(
9693
} else {
9794
false
9895
}
99-
} catch (e: Exception) {
100-
e.printStackTrace()
96+
} catch (_: Exception) {
10197
false
10298
}
10399
}
@@ -114,8 +110,7 @@ class FileStorageManager(
114110
} else {
115111
true
116112
}
117-
} catch (e: Exception) {
118-
e.printStackTrace()
113+
} catch (_: Exception) {
119114
false
120115
}
121116
}
@@ -132,8 +127,7 @@ class FileStorageManager(
132127
} else {
133128
true
134129
}
135-
} catch (e: Exception) {
136-
e.printStackTrace()
130+
} catch (_: Exception) {
137131
false
138132
}
139133
}
@@ -144,7 +138,7 @@ class FileStorageManager(
144138
fun imageExists(filePath: String): Boolean {
145139
return try {
146140
fileSystem.exists(filePath.toPath())
147-
} catch (e: Exception) {
141+
} catch (_: Exception) {
148142
false
149143
}
150144
}

domain/src/commonMain/kotlin/mehiz/abdallah/progres/domain/ImageMigrationUseCase.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package mehiz.abdallah.progres.domain
22

3+
import kotlinx.coroutines.Dispatchers
4+
import kotlinx.coroutines.withContext
35
import mehiz.abdallah.progres.data.daos.IndividualInfoDao
46
import mehiz.abdallah.progres.data.daos.StudentCardDao
57
import utils.FileStorageManager
6-
import kotlinx.coroutines.Dispatchers
7-
import kotlinx.coroutines.withContext
88

99
/**
1010
* Handles migration of image data from database BLOBs to file storage

domain/src/commonMain/kotlin/mehiz/abdallah/progres/domain/StudentCardUseCase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package mehiz.abdallah.progres.domain
22

3+
import kotlin.uuid.ExperimentalUuidApi
34
import mehiz.abdallah.progres.api.ProgresApi
45
import mehiz.abdallah.progres.data.daos.IndividualInfoDao
56
import mehiz.abdallah.progres.data.daos.StudentCardDao
@@ -8,7 +9,6 @@ import mehiz.abdallah.progres.domain.models.StudentCardModel
89
import mehiz.abdallah.progres.domain.models.toModel
910
import mehiz.abdallah.progres.domain.models.toTable
1011
import utils.FileStorageManager
11-
import kotlin.uuid.ExperimentalUuidApi
1212

1313
class StudentCardUseCase(
1414
private val api: ProgresApi,

0 commit comments

Comments
 (0)