@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)
Creates a
ThrowableProblem when the root cause was not an exception of type ThrowableProblem. |
protected boolean |
includeErrorMessage(io.micronaut.http.server.exceptions.response.ErrorContext errorContext)
Whether
ThrowableProblem, created when the root cause is not an exception of type ThrowableProblem, should
contain Error::getMessage in the problem detail. |
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)
ThrowableProblem when the root cause was not an exception of type ThrowableProblem.errorContext - Error ContexthttpStatus - HTTP Statusprotected boolean includeErrorMessage(@NonNull
io.micronaut.http.server.exceptions.response.ErrorContext errorContext)
ThrowableProblem, created when the root cause is not an exception of type ThrowableProblem, should
contain Error::getMessage in the problem detail.
To avoid accidental information leakage defaults to false unless the root cause is of type UnsatisfiedRouteException
which contains helpful information to diagnose the issue (e.g. missing required query value) in the details.errorContext - Error ContextUnsatisfiedRouteException