Simplify conditional expression
This commit is contained in:
parent
11fcb7a586
commit
6a08c4568b
|
|
@ -6,6 +6,7 @@ plugins {
|
|||
|
||||
dependencies {
|
||||
api(project(":common"))
|
||||
api(project(":common-spring"))
|
||||
api(project(":common-spring-web"))
|
||||
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
package ru.touchin.exception.handler.spring.resolvers
|
||||
|
||||
import org.springframework.core.Ordered
|
||||
import org.springframework.core.annotation.Order
|
||||
import org.springframework.stereotype.Component
|
||||
import ru.touchin.common.exceptions.CommonNotFoundException
|
||||
import ru.touchin.common.spring.Ordered
|
||||
import ru.touchin.exception.handler.dto.ExceptionResolverResult
|
||||
|
||||
@Order(Ordered.LOWEST_PRECEDENCE - 1)
|
||||
@Order(Ordered.LOW)
|
||||
@Component
|
||||
class NotFoundExceptionResolver : ExceptionResolver {
|
||||
|
||||
override fun invoke(exception: Exception): ExceptionResolverResult? {
|
||||
return if (exception is CommonNotFoundException) {
|
||||
if (exception !is CommonNotFoundException) {
|
||||
ExceptionResolverResult.createNotFoundError(exception)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue