@API(status=STABLE)
public interface AdviceTrait
Advice traits are simple interfaces that provide a single method with a default
implementation. They are used to provide ExceptionHandler implementations to be used in
Controllers and/or in a ControllerAdvice. Clients can choose which traits they what to
use à la carte.
Advice traits are grouped in packages, based on they use cases. Every package has a composite advice trait that
bundles all traits of that package. Additionally there is one major composite advice trait
that in turn bundles all other composites.
ControllerAdvice,
ExceptionHandler,
Throwable,
Exception,
Problem,
ProblemHandling,
CustomAdviceTrait,
GeneralAdviceTrait,
HttpAdviceTrait,
IOAdviceTrait,
RoutingAdviceTrait,
ValidationAdviceTrait| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Modifier and Type | Method and Description |
|---|---|
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
create(org.zalando.problem.StatusType status,
Throwable throwable,
org.springframework.web.context.request.NativeWebRequest request) |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
create(org.zalando.problem.StatusType status,
Throwable throwable,
org.springframework.web.context.request.NativeWebRequest request,
org.springframework.http.HttpHeaders headers) |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
create(org.zalando.problem.StatusType status,
Throwable throwable,
org.springframework.web.context.request.NativeWebRequest request,
org.springframework.http.HttpHeaders headers,
URI type) |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
create(org.zalando.problem.StatusType status,
Throwable throwable,
org.springframework.web.context.request.NativeWebRequest request,
URI type) |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
create(Throwable throwable,
org.springframework.web.context.request.NativeWebRequest request)
Creates a
problem response for the given throwable
by taking any ResponseStatus annotation on the exception type or one of the causes into account. |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
create(org.zalando.problem.ThrowableProblem problem,
org.springframework.web.context.request.NativeWebRequest request) |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
create(Throwable throwable,
org.zalando.problem.Problem problem,
org.springframework.web.context.request.NativeWebRequest request) |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
create(org.zalando.problem.ThrowableProblem problem,
org.springframework.web.context.request.NativeWebRequest request,
org.springframework.http.HttpHeaders headers) |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
create(Throwable throwable,
org.zalando.problem.Problem problem,
org.springframework.web.context.request.NativeWebRequest request,
org.springframework.http.HttpHeaders headers) |
default StackTraceElement[] |
createStackTrace(Throwable throwable) |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
fallback(Throwable throwable,
org.zalando.problem.Problem problem,
org.springframework.web.context.request.NativeWebRequest request,
org.springframework.http.HttpHeaders headers) |
default boolean |
isCausalChainsEnabled() |
default void |
log(Throwable throwable,
org.zalando.problem.Problem problem,
org.springframework.web.context.request.NativeWebRequest request,
org.springframework.http.HttpStatus status) |
default Optional<org.springframework.http.MediaType> |
negotiate(org.springframework.web.context.request.NativeWebRequest request) |
default org.zalando.problem.ProblemBuilder |
prepare(Throwable throwable,
org.zalando.problem.StatusType status,
URI type) |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
process(org.springframework.http.ResponseEntity<org.zalando.problem.Problem> entity) |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> |
process(org.springframework.http.ResponseEntity<org.zalando.problem.Problem> entity,
org.springframework.web.context.request.NativeWebRequest request) |
default org.springframework.web.bind.annotation.ResponseStatus |
resolveResponseStatus(Throwable type) |
default org.zalando.problem.ThrowableProblem |
toProblem(Throwable throwable) |
default org.zalando.problem.ThrowableProblem |
toProblem(Throwable throwable,
org.zalando.problem.StatusType status) |
default org.zalando.problem.ThrowableProblem |
toProblem(Throwable throwable,
org.zalando.problem.StatusType status,
URI type) |
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(Throwable throwable, org.springframework.web.context.request.NativeWebRequest request)
problem response for the given throwable
by taking any ResponseStatus annotation on the exception type or one of the causes into account.throwable - exception being caughtrequest - incoming requestResponseStatusExceptionResolverdefault org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(org.zalando.problem.StatusType status,
Throwable throwable,
org.springframework.web.context.request.NativeWebRequest request)
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(org.zalando.problem.StatusType status,
Throwable throwable,
org.springframework.web.context.request.NativeWebRequest request,
org.springframework.http.HttpHeaders headers)
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(org.zalando.problem.StatusType status,
Throwable throwable,
org.springframework.web.context.request.NativeWebRequest request,
URI type)
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(org.zalando.problem.StatusType status,
Throwable throwable,
org.springframework.web.context.request.NativeWebRequest request,
org.springframework.http.HttpHeaders headers,
URI type)
default org.zalando.problem.ThrowableProblem toProblem(Throwable throwable)
@API(status=MAINTAINED) default org.springframework.web.bind.annotation.ResponseStatus resolveResponseStatus(Throwable type)
default org.zalando.problem.ThrowableProblem toProblem(Throwable throwable, org.zalando.problem.StatusType status)
default org.zalando.problem.ThrowableProblem toProblem(Throwable throwable, org.zalando.problem.StatusType status, URI type)
default org.zalando.problem.ProblemBuilder prepare(Throwable throwable, org.zalando.problem.StatusType status, URI type)
default StackTraceElement[] createStackTrace(Throwable throwable)
default boolean isCausalChainsEnabled()
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(org.zalando.problem.ThrowableProblem problem,
org.springframework.web.context.request.NativeWebRequest request)
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(org.zalando.problem.ThrowableProblem problem,
org.springframework.web.context.request.NativeWebRequest request,
org.springframework.http.HttpHeaders headers)
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(Throwable throwable, org.zalando.problem.Problem problem, org.springframework.web.context.request.NativeWebRequest request)
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(Throwable throwable, org.zalando.problem.Problem problem, org.springframework.web.context.request.NativeWebRequest request, org.springframework.http.HttpHeaders headers)
default void log(Throwable throwable, org.zalando.problem.Problem problem, org.springframework.web.context.request.NativeWebRequest request, org.springframework.http.HttpStatus status)
default Optional<org.springframework.http.MediaType> negotiate(org.springframework.web.context.request.NativeWebRequest request)
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> fallback(Throwable throwable, org.zalando.problem.Problem problem, org.springframework.web.context.request.NativeWebRequest request, org.springframework.http.HttpHeaders headers)
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> process(org.springframework.http.ResponseEntity<org.zalando.problem.Problem> entity,
org.springframework.web.context.request.NativeWebRequest request)
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> process(org.springframework.http.ResponseEntity<org.zalando.problem.Problem> entity)
Copyright © 2015–2018 Zalando SE. All rights reserved.