Class NtsExceptionTranslator

  • All Implemented Interfaces:
    org.zalando.problem.spring.common.AdviceTrait, org.zalando.problem.spring.webflux.advice.AdviceTrait, org.zalando.problem.spring.webflux.advice.general.GeneralAdviceTrait, org.zalando.problem.spring.webflux.advice.general.ProblemAdviceTrait, org.zalando.problem.spring.webflux.advice.general.ThrowableAdviceTrait, org.zalando.problem.spring.webflux.advice.general.UnsupportedOperationAdviceTrait, org.zalando.problem.spring.webflux.advice.http.HttpAdviceTrait, org.zalando.problem.spring.webflux.advice.http.MethodNotAllowedAdviceTrait, org.zalando.problem.spring.webflux.advice.http.NotAcceptableAdviceTrait, org.zalando.problem.spring.webflux.advice.http.ResponseStatusAdviceTrait, org.zalando.problem.spring.webflux.advice.http.UnsupportedMediaTypeAdviceTrait, org.zalando.problem.spring.webflux.advice.network.NetworkAdviceTrait, org.zalando.problem.spring.webflux.advice.network.SocketTimeoutAdviceTrait, org.zalando.problem.spring.webflux.advice.ProblemHandling, org.zalando.problem.spring.webflux.advice.security.AccessDeniedAdviceTrait, org.zalando.problem.spring.webflux.advice.security.AuthenticationAdviceTrait, org.zalando.problem.spring.webflux.advice.security.SecurityAdviceTrait, org.zalando.problem.spring.webflux.advice.SpringAdviceTrait, org.zalando.problem.spring.webflux.advice.validation.BaseBindingResultAdviceTrait, org.zalando.problem.spring.webflux.advice.validation.BindAdviceTrait, org.zalando.problem.spring.webflux.advice.validation.ConstraintViolationAdviceTrait, org.zalando.problem.spring.webflux.advice.validation.ValidationAdviceTrait

    @ConditionalOnProperty(prefix="nts.web.rest.exception-translator",
                           name="enabled",
                           havingValue="true",
                           matchIfMissing=true)
    @ControllerAdvice
    @ConditionalOnMissingBean(name="exceptionTranslator")
    public class NtsExceptionTranslator
    extends Object
    implements org.zalando.problem.spring.webflux.advice.ProblemHandling, org.zalando.problem.spring.webflux.advice.security.SecurityAdviceTrait
    Controller advice to translate the server side exceptions to client-friendly json structures. The error response follows RFC7807 - Problem Details for HTTP APIs (RFC7807).
    • Method Summary

      All Methods Instance Methods Concrete Methods Default Methods 
      Modifier and Type Method Description
      org.zalando.problem.StatusType defaultConstraintViolationStatus()  
      default URI defaultConstraintViolationType()  
      String formatFieldName​(String fieldName)  
      default reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<org.zalando.problem.Problem>> newConstraintViolationProblem​(Throwable arg0, Collection<org.zalando.problem.violations.Violation> arg1, org.springframework.web.server.ServerWebExchange arg2)  
      org.springframework.http.ResponseEntity<org.zalando.problem.Problem> process​(org.springframework.http.ResponseEntity<org.zalando.problem.Problem> entity)  
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.security.AccessDeniedAdviceTrait

        handleAccessDenied
      • Methods inherited from interface org.zalando.problem.spring.common.AdviceTrait

        createStackTrace, isCausalChainsEnabled, prepare, resolveResponseStatus, toProblem, toProblem, toProblem
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.AdviceTrait

        create, create, create, create, create, create, create, create, create, fallback, log, negotiate, process
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.security.AuthenticationAdviceTrait

        handleAuthentication
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.validation.BaseBindingResultAdviceTrait

        createViolation, createViolation, createViolations
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.validation.BindAdviceTrait

        handleBindingResult
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.validation.ConstraintViolationAdviceTrait

        createViolation, handleConstraintViolation
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.http.MethodNotAllowedAdviceTrait

        handleRequestMethodNotSupportedException
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.http.NotAcceptableAdviceTrait

        handleMediaTypeNotAcceptable
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.general.ProblemAdviceTrait

        handleProblem
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.http.ResponseStatusAdviceTrait

        handleResponseStatusException
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.network.SocketTimeoutAdviceTrait

        handleSocketTimeout
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.SpringAdviceTrait

        create, create, toProblem, toStatus
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.general.ThrowableAdviceTrait

        handleThrowable
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.http.UnsupportedMediaTypeAdviceTrait

        handleMediaTypeNotSupportedException
      • Methods inherited from interface org.zalando.problem.spring.webflux.advice.general.UnsupportedOperationAdviceTrait

        handleUnsupportedOperation
    • Constructor Detail

      • NtsExceptionTranslator

        public NtsExceptionTranslator()
    • Method Detail

      • process

        public org.springframework.http.ResponseEntity<org.zalando.problem.Problem> process​(org.springframework.http.ResponseEntity<org.zalando.problem.Problem> entity)
        Specified by:
        process in interface org.zalando.problem.spring.common.AdviceTrait
      • defaultConstraintViolationStatus

        public org.zalando.problem.StatusType defaultConstraintViolationStatus()
      • formatFieldName

        public String formatFieldName​(@Nullable
                                      String fieldName)
      • defaultConstraintViolationType

        public default URI defaultConstraintViolationType()
      • newConstraintViolationProblem

        public default reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<org.zalando.problem.Problem>> newConstraintViolationProblem​(Throwable arg0,
                                                                                                                                                       Collection<org.zalando.problem.violations.Violation> arg1,
                                                                                                                                                       org.springframework.web.server.ServerWebExchange arg2)