Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML4SE-168] Fixed detekt.
Browse files Browse the repository at this point in the history
mikrise2 committed Dec 6, 2023
1 parent 27128ff commit 44f1bc9
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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
}
}
Original file line number Diff line number Diff line change
@@ -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
}
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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)
@@ -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)
}
}

0 comments on commit 44f1bc9

Please sign in to comment.