Skip to content

Commit

Permalink
[ML4SE-168] Fixed detekt.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikrise2 committed Dec 6, 2023
1 parent 27128ff commit 44f1bc9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ object FileRequests {
)
true
} catch (e: IllegalStateException) {
logger.error(e.localizedMessage)
logger.warn(e.localizedMessage)
false
} catch (e: Exception) {
logger.error("Server interaction error! File to send: ${file.path}", e)
logger.warn("Server interaction error! File to send: ${file.path}", e)
false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object IdRequests {
}
).body<Int>()
} catch (e: Exception) {
logger.error("Server interaction error while getting user id! Url: $url", e)
logger.warn("Server interaction error while getting user id! Url: $url", e)
}
return@runBlocking null
}
Expand All @@ -50,9 +50,9 @@ object IdRequests {
}
).body<Int>()
} catch (e: IllegalArgumentException) {
logger.error(e.localizedMessage)
logger.warn(e.localizedMessage)
} catch (e: Exception) {
logger.error("Server interaction error while getting user id! Url: $url", e)
logger.warn("Server interaction error while getting user id! Url: $url", e)
}
return@runBlocking null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import org.jetbrains.research.tasktracker.util.logFile.parseLogFile

private const val DEFAULT_FOLDER = "default"

@Suppress("TooGenericExceptionCaught")
fun Routing.uploadLogFile() {
post("/upload-log-file") {
try {
val parameters = call.parameters
val logFileType = parameters["logFileType"]?: DEFAULT_FOLDER
val logFileType = parameters["logFileType"] ?: DEFAULT_FOLDER
val researchId = parameters.getOrFail<Int>("id")
val logFile = createLogFile(logFileType, researchId)
logFile.parseLogFile(logFileType, researchId)
Expand All @@ -24,7 +25,7 @@ fun Routing.uploadLogFile() {
call.respond(HttpStatusCode.BadRequest, e.localizedMessage)
} catch (e: ParameterConversionException) {
call.respond(HttpStatusCode.BadRequest, e.localizedMessage)
} catch (e: Exception){
} catch (e: Exception) {
call.respond(HttpStatusCode.BadRequest, e.localizedMessage)
}
}
Expand Down

0 comments on commit 44f1bc9

Please sign in to comment.