Interface AdviceTrait
-
- All Superinterfaces:
AdviceTrait
- All Known Subinterfaces:
AccessDeniedAdviceTrait,AuthenticationAdviceTrait,BaseBindingResultAdviceTrait,org.zalando.problem.spring.web.advice.validation.BaseValidationAdviceTrait,BindAdviceTrait,CircuitBreakerOpenAdviceTrait,ConstraintViolationAdviceTrait,GeneralAdviceTrait,HttpAdviceTrait,IOAdviceTrait,MessageNotReadableAdviceTrait,MethodArgumentNotValidAdviceTrait,MethodNotAllowedAdviceTrait,MissingServletRequestParameterAdviceTrait,MissingServletRequestPartAdviceTrait,MultipartAdviceTrait,NetworkAdviceTrait,NoHandlerFoundAdviceTrait,NotAcceptableAdviceTrait,OpenApiValidationAdviceTrait,ProblemAdviceTrait,ProblemHandling,ResponseStatusAdviceTrait,RoutingAdviceTrait,SecurityAdviceTrait,ServletRequestBindingAdviceTrait,SocketTimeoutAdviceTrait,SpringAdviceTrait,ThrowableAdviceTrait,TypeMismatchAdviceTrait,TypeMistmatchAdviceTrait,UnsupportedMediaTypeAdviceTrait,UnsupportedOperationAdviceTrait,ValidationAdviceTrait
@API(status=STABLE) public interface AdviceTrait extends AdviceTrait
Advice traits are simple interfaces that provide a single method with a default implementation. They are used to provide
ExceptionHandlerimplementations to be used inControllersand/or in aControllerAdvice. 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 traitthat in turn bundles all other composites.- See Also:
ControllerAdvice,ExceptionHandler,Throwable,Exception,Problem,ProblemHandling,CustomAdviceTrait,GeneralAdviceTrait,HttpAdviceTrait,IOAdviceTrait,NetworkAdviceTrait,RoutingAdviceTrait,ValidationAdviceTrait
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default org.springframework.http.ResponseEntity<org.zalando.problem.Problem>create(Throwable throwable, org.springframework.web.context.request.NativeWebRequest request)Creates aproblemresponsefor the giventhrowableby taking anyResponseStatusannotation on the exception type or one of the causes into account.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 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, 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)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.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>fallback(Throwable throwable, org.zalando.problem.Problem problem, org.springframework.web.context.request.NativeWebRequest request, org.springframework.http.HttpHeaders headers)default voidlog(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>process(org.springframework.http.ResponseEntity<org.zalando.problem.Problem> entity, org.springframework.web.context.request.NativeWebRequest request)-
Methods inherited from interface org.zalando.problem.spring.common.AdviceTrait
createStackTrace, isCausalChainsEnabled, prepare, process, resolveResponseStatus, toProblem, toProblem, toProblem
-
-
-
-
Method Detail
-
create
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(Throwable throwable, org.springframework.web.context.request.NativeWebRequest request)
Creates aproblemresponsefor the giventhrowableby taking anyResponseStatusannotation on the exception type or one of the causes into account.- Parameters:
throwable- exception being caughtrequest- incoming request- Returns:
- the problem response
-
create
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(org.zalando.problem.StatusType status, Throwable throwable, org.springframework.web.context.request.NativeWebRequest request)
-
create
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)
-
create
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)
-
create
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)
-
create
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(org.zalando.problem.ThrowableProblem problem, org.springframework.web.context.request.NativeWebRequest request)
-
create
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)
-
create
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> create(Throwable throwable, org.zalando.problem.Problem problem, org.springframework.web.context.request.NativeWebRequest request)
-
create
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)
-
log
default void log(Throwable throwable, org.zalando.problem.Problem problem, org.springframework.web.context.request.NativeWebRequest request, org.springframework.http.HttpStatus status)
-
negotiate
default Optional<org.springframework.http.MediaType> negotiate(org.springframework.web.context.request.NativeWebRequest request)
-
fallback
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)
-
process
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)
-
-