Package io.micronaut.problem
Class ProblemErrorResponseProcessor
java.lang.Object
io.micronaut.problem.ProblemErrorResponseProcessor
- All Implemented Interfaces:
- io.micronaut.http.server.exceptions.response.ErrorResponseProcessor<org.zalando.problem.Problem>
@Deprecated(forRemoval=true)
public class ProblemErrorResponseProcessor
extends Object
implements io.micronaut.http.server.exceptions.response.ErrorResponseProcessor<org.zalando.problem.Problem>
Deprecated, for removal: This API element is subject to removal in a future version.
Error Response processor to respond 
Problem responses.
 - Adds application/problem+json content type
- If the cause is a ThrowableProblem, it returns as the body.
- If the cause is not a ThrowableProblem, it generates a default Problem based on theErrorContextand returns it as the HTTP Body.
- Since:
- 1.0
- Author:
- Sergio del Amo
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionprotected @NonNull org.zalando.problem.ThrowableProblemdefaultProblem(@NonNull io.micronaut.http.server.exceptions.response.ErrorContext errorContext, @NonNull io.micronaut.http.HttpStatus httpStatus) Deprecated, for removal: This API element is subject to removal in a future version.Creates aThrowableProblemwhen the root cause was not an exception of typeThrowableProblem.protected booleanincludeErrorMessage(@NonNull io.micronaut.http.server.exceptions.response.ErrorContext errorContext) Deprecated, for removal: This API element is subject to removal in a future version.WhetherThrowableProblem, created when the root cause is not an exception of typeThrowableProblem, should contain Error::getMessage in the problem detail.@NonNull io.micronaut.http.MutableHttpResponse<org.zalando.problem.Problem> processResponse(@NonNull io.micronaut.http.server.exceptions.response.ErrorContext errorContext, @NonNull io.micronaut.http.MutableHttpResponse<?> baseResponse) Deprecated, for removal: This API element is subject to removal in a future version.
- 
Field Details- 
APPLICATION_PROBLEM_JSONDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
 
 
- 
- 
Constructor Details- 
ProblemErrorResponseProcessorDeprecated, for removal: This API element is subject to removal in a future version.Constructor.- Parameters:
- config- Problem configuration
 
 
- 
- 
Method Details- 
processResponse@NonNull public @NonNull io.micronaut.http.MutableHttpResponse<org.zalando.problem.Problem> processResponse(@NonNull @NonNull io.micronaut.http.server.exceptions.response.ErrorContext errorContext, @NonNull @NonNull io.micronaut.http.MutableHttpResponse<?> baseResponse) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
- processResponsein interface- io.micronaut.http.server.exceptions.response.ErrorResponseProcessor<org.zalando.problem.Problem>
 
- 
defaultProblem@NonNull protected @NonNull org.zalando.problem.ThrowableProblem defaultProblem(@NonNull @NonNull io.micronaut.http.server.exceptions.response.ErrorContext errorContext, @NonNull @NonNull io.micronaut.http.HttpStatus httpStatus) Deprecated, for removal: This API element is subject to removal in a future version.Creates aThrowableProblemwhen the root cause was not an exception of typeThrowableProblem.- Parameters:
- errorContext- Error Context
- httpStatus- HTTP Status
- Returns:
- Default problem
 
- 
includeErrorMessageprotected boolean includeErrorMessage(@NonNull @NonNull io.micronaut.http.server.exceptions.response.ErrorContext errorContext) Deprecated, for removal: This API element is subject to removal in a future version.WhetherThrowableProblem, created when the root cause is not an exception of typeThrowableProblem, should contain Error::getMessage in the problem detail. To avoid accidental information leakage defaults to false unless the root cause is of typeUnsatisfiedRouteExceptionwhich contains helpful information to diagnose the issue (e.g. missing required query value) in the details.- Parameters:
- errorContext- Error Context
- Returns:
- To avoid accidental information leakage defaults to false unless the root cause is of type UnsatisfiedRouteException
 
 
- 
ProblemJsonErrorResponseBodyProviderinstead.