Skip to content

Commit

Permalink
Add ExecutesOn annotation to error controller
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Nov 26, 2024
1 parent 6322000 commit a2db2b0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import io.micronaut.http.HttpResponse
import io.micronaut.http.annotation.Controller
import io.micronaut.http.annotation.Error
import io.micronaut.http.hateoas.JsonError
import io.micronaut.scheduling.TaskExecutors
import io.micronaut.scheduling.annotation.ExecuteOn
import io.seqera.wave.ErrorHandler
import jakarta.inject.Inject
/**
Expand All @@ -35,9 +37,11 @@ import jakarta.inject.Inject
@Slf4j
@CompileStatic
@Controller('/error')
@ExecuteOn(TaskExecutors.BLOCKING)
class ErrorController {

@Inject ErrorHandler handler
@Inject
private ErrorHandler handler

@Error(global = true)
HttpResponse<JsonError> handleException(HttpRequest request, Throwable exception) {
Expand Down

0 comments on commit a2db2b0

Please sign in to comment.