Interface ProblemHandling
-
- All Superinterfaces:
AdviceTrait,AdviceTrait,BaseBindingResultAdviceTrait,BindAdviceTrait,ConstraintViolationAdviceTrait,GeneralAdviceTrait,HttpAdviceTrait,IOAdviceTrait,MessageNotReadableAdviceTrait,MethodArgumentNotValidAdviceTrait,MethodNotAllowedAdviceTrait,MissingServletRequestParameterAdviceTrait,MissingServletRequestPartAdviceTrait,MultipartAdviceTrait,NetworkAdviceTrait,NoHandlerFoundAdviceTrait,NotAcceptableAdviceTrait,ProblemAdviceTrait,ResponseStatusAdviceTrait,RoutingAdviceTrait,ServletRequestBindingAdviceTrait,SocketTimeoutAdviceTrait,ThrowableAdviceTrait,TypeMismatchAdviceTrait,UnsupportedMediaTypeAdviceTrait,UnsupportedOperationAdviceTrait,ValidationAdviceTrait
@API(status=STABLE) public interface ProblemHandling extends GeneralAdviceTrait, HttpAdviceTrait, IOAdviceTrait, NetworkAdviceTrait, RoutingAdviceTrait, ValidationAdviceTrait
ProblemHandlingis a compositeAdviceTraitthat combines all built-in advice traits into a single interface that makes it easier to use:
Note: Future versions of this class will be extended with additional traits.@ControllerAdvice public class ExceptionHandling implements ProblemHandling
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default org.zalando.problem.StatusTypedefaultConstraintViolationStatus()default URIdefaultConstraintViolationType()default StringformatFieldName(String fieldName)Format the name of a violating field (e.g.default org.springframework.http.ResponseEntity<org.zalando.problem.Problem>newConstraintViolationProblem(Throwable throwable, Collection<Violation> stream, 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
-
Methods inherited from interface org.zalando.problem.spring.web.advice.AdviceTrait
create, create, create, create, create, create, create, create, create, fallback, log, negotiate, process
-
Methods inherited from interface org.zalando.problem.spring.web.advice.validation.BaseBindingResultAdviceTrait
createViolation, createViolation, createViolations
-
Methods inherited from interface org.zalando.problem.spring.web.advice.validation.BindAdviceTrait
handleBindingResult
-
Methods inherited from interface org.zalando.problem.spring.web.advice.validation.ConstraintViolationAdviceTrait
createViolation, handleConstraintViolation
-
Methods inherited from interface org.zalando.problem.spring.web.advice.io.MessageNotReadableAdviceTrait
handleMessageNotReadableException
-
Methods inherited from interface org.zalando.problem.spring.web.advice.validation.MethodArgumentNotValidAdviceTrait
handleMethodArgumentNotValid
-
Methods inherited from interface org.zalando.problem.spring.web.advice.http.MethodNotAllowedAdviceTrait
handleRequestMethodNotSupportedException
-
Methods inherited from interface org.zalando.problem.spring.web.advice.routing.MissingServletRequestParameterAdviceTrait
handleMissingServletRequestParameter
-
Methods inherited from interface org.zalando.problem.spring.web.advice.routing.MissingServletRequestPartAdviceTrait
handleMissingServletRequestPart
-
Methods inherited from interface org.zalando.problem.spring.web.advice.io.MultipartAdviceTrait
handleMultipart
-
Methods inherited from interface org.zalando.problem.spring.web.advice.routing.NoHandlerFoundAdviceTrait
handleNoHandlerFound
-
Methods inherited from interface org.zalando.problem.spring.web.advice.http.NotAcceptableAdviceTrait
handleMediaTypeNotAcceptable
-
Methods inherited from interface org.zalando.problem.spring.web.advice.general.ProblemAdviceTrait
handleProblem
-
Methods inherited from interface org.zalando.problem.spring.web.advice.general.ResponseStatusAdviceTrait
handleResponseStatusException
-
Methods inherited from interface org.zalando.problem.spring.web.advice.routing.ServletRequestBindingAdviceTrait
handleServletRequestBinding
-
Methods inherited from interface org.zalando.problem.spring.web.advice.network.SocketTimeoutAdviceTrait
handleSocketTimeout
-
Methods inherited from interface org.zalando.problem.spring.web.advice.general.ThrowableAdviceTrait
handleThrowable
-
Methods inherited from interface org.zalando.problem.spring.web.advice.io.TypeMismatchAdviceTrait
handleTypeMismatch
-
Methods inherited from interface org.zalando.problem.spring.web.advice.http.UnsupportedMediaTypeAdviceTrait
handleMediaTypeNotSupportedException
-
Methods inherited from interface org.zalando.problem.spring.web.advice.general.UnsupportedOperationAdviceTrait
handleUnsupportedOperation
-
-
-
-
Method Detail
-
defaultConstraintViolationType
default URI defaultConstraintViolationType()
-
defaultConstraintViolationStatus
default org.zalando.problem.StatusType defaultConstraintViolationStatus()
-
formatFieldName
default String formatFieldName(String fieldName)
Format the name of a violating field (e.g. lower camel to snake case)- Parameters:
fieldName- the field name to format- Returns:
- the formatted field name, defaults to the parameter, i.e. doesn't apply any transformation
-
newConstraintViolationProblem
default org.springframework.http.ResponseEntity<org.zalando.problem.Problem> newConstraintViolationProblem(Throwable throwable, Collection<Violation> stream, org.springframework.web.context.request.NativeWebRequest request)
-
-