forked from Cookies_Github_mirror/AquaDX
[O] More logging
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package icu.samnyan.aqua.net.utils
|
||||
|
||||
import ext.Str
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler
|
||||
@@ -8,7 +9,11 @@ import org.springframework.web.bind.annotation.ExceptionHandler
|
||||
|
||||
val SUCCESS = ResponseEntity.ok().body(mapOf("status" to "ok"))
|
||||
|
||||
class ApiException(val code: Int, message: Str) : RuntimeException(message)
|
||||
class ApiException(val code: Int, message: Str) : RuntimeException(message) {
|
||||
companion object {
|
||||
val log = LoggerFactory.getLogger(ApiException::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
@ControllerAdvice
|
||||
class GlobalExceptionHandler {
|
||||
|
||||
Reference in New Issue
Block a user