@Singleton
public class ProblemErrorResponseProcessor
extends java.lang.Object
implements io.micronaut.http.server.exceptions.response.ErrorResponseProcessor<org.zalando.problem.Problem>
Problem
responses.
ThrowableProblem
, it returns as the body.ThrowableProblem
, it generates a default Problem based on the ErrorContext
and returns it as the HTTP Body.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPLICATION_PROBLEM_JSON |
Constructor and Description |
---|
ProblemErrorResponseProcessor()
Deprecated.
|
ProblemErrorResponseProcessor(ProblemConfiguration config)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected org.zalando.problem.ThrowableProblem |
defaultProblem(io.micronaut.http.server.exceptions.response.ErrorContext errorContext,
io.micronaut.http.HttpStatus httpStatus) |
io.micronaut.http.MutableHttpResponse<org.zalando.problem.Problem> |
processResponse(io.micronaut.http.server.exceptions.response.ErrorContext errorContext,
io.micronaut.http.MutableHttpResponse<?> baseResponse) |
public static final java.lang.String APPLICATION_PROBLEM_JSON
@Deprecated public ProblemErrorResponseProcessor()
ProblemErrorResponseProcessor(ProblemConfiguration)
instead.@Inject public ProblemErrorResponseProcessor(ProblemConfiguration config)
config
- Problem configuration@NonNull public io.micronaut.http.MutableHttpResponse<org.zalando.problem.Problem> processResponse(@NonNull io.micronaut.http.server.exceptions.response.ErrorContext errorContext, @NonNull io.micronaut.http.MutableHttpResponse<?> baseResponse)
processResponse
in interface io.micronaut.http.server.exceptions.response.ErrorResponseProcessor<org.zalando.problem.Problem>
@NonNull protected org.zalando.problem.ThrowableProblem defaultProblem(@NonNull io.micronaut.http.server.exceptions.response.ErrorContext errorContext, @NonNull io.micronaut.http.HttpStatus httpStatus)
errorContext
- Error ContexthttpStatus
- HTTP Status