Skip to content

Commit

Permalink
CancellationException 도 예외처리
Browse files Browse the repository at this point in the history
  • Loading branch information
Hank-Choi committed Feb 14, 2025
1 parent ed68a47 commit 3433bd5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/src/main/kotlin/filter/ErrorWebFilter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.springframework.web.server.WebFilter
import org.springframework.web.server.WebFilterChain
import reactor.core.publisher.Mono
import reactor.netty.channel.AbortedException
import kotlinx.coroutines.CancellationException

@Component
class ErrorWebFilter(
Expand Down Expand Up @@ -46,9 +47,9 @@ class ErrorWebFilter(
SnuttException(errorMessage = throwable.body.title ?: ErrorType.DEFAULT_ERROR.errorMessage),
)
}
is AbortedException -> {
httpStatusCode = HttpStatus.GATEWAY_TIMEOUT
errorBody = makeErrorBody(SnuttException())
is AbortedException, is CancellationException -> {
httpStatusCode = HttpStatus.NO_CONTENT
errorBody = emptyMap<String, Any>()
}
else -> {
log.error(throwable.message, throwable)
Expand Down

0 comments on commit 3433bd5

Please sign in to comment.