Class HateoasErrorResponseProcessor
- java.lang.Object
-
- io.micronaut.http.server.exceptions.response.HateoasErrorResponseProcessor
-
- All Implemented Interfaces:
ErrorResponseProcessor<io.micronaut.http.hateoas.JsonError>
@Singleton @Secondary public class HateoasErrorResponseProcessor extends java.lang.Object implements ErrorResponseProcessor<io.micronaut.http.hateoas.JsonError>
Creates Hateoas JSON error responses.- Since:
- 2.4.0
-
-
Constructor Summary
Constructors Constructor Description HateoasErrorResponseProcessor(io.micronaut.jackson.JacksonConfiguration jacksonConfiguration)Deprecated.UseHateoasErrorResponseProcessor(JsonConfiguration)instead.HateoasErrorResponseProcessor(io.micronaut.json.JsonConfiguration jacksonConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.micronaut.http.MutableHttpResponse<io.micronaut.http.hateoas.JsonError>processResponse(ErrorContext errorContext, io.micronaut.http.MutableHttpResponse<?> response)Modifies the http response representing the error.
-
-
-
Constructor Detail
-
HateoasErrorResponseProcessor
public HateoasErrorResponseProcessor(io.micronaut.json.JsonConfiguration jacksonConfiguration)
-
HateoasErrorResponseProcessor
@Deprecated public HateoasErrorResponseProcessor(io.micronaut.jackson.JacksonConfiguration jacksonConfiguration)
Deprecated.UseHateoasErrorResponseProcessor(JsonConfiguration)instead.Constructor for binary compatibility. Equivalent toHateoasErrorResponseProcessor(JsonConfiguration)- Parameters:
jacksonConfiguration- the configuration to use for processing.
-
-
Method Detail
-
processResponse
@NonNull public io.micronaut.http.MutableHttpResponse<io.micronaut.http.hateoas.JsonError> processResponse(@NonNull ErrorContext errorContext, @NonNull io.micronaut.http.MutableHttpResponse<?> response)Description copied from interface:ErrorResponseProcessorModifies the http response representing the error. Callers of this method should return the response that was passed in baseResponse parameter, however that isn't required. Error response processors should not set the body or content type if the request method is HEAD.- Specified by:
processResponsein interfaceErrorResponseProcessor<io.micronaut.http.hateoas.JsonError>- Parameters:
errorContext- The error contextresponse- The base response to retrieve information or mutate- Returns:
- An error response
-
-