Class NtsExceptionTranslator


  • @ConditionalOnProperty(prefix="nts.web.rest.exception-translator",
                           name="enabled",
                           havingValue="true",
                           matchIfMissing=true)
    @ControllerAdvice
    @ConditionalOnMissingBean(name="exceptionTranslator")
    public class NtsExceptionTranslator
    extends ResponseEntityExceptionHandler
    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 
      Modifier and Type Method Description
      protected Map<String,​List<String>> buildUnprocessableErrors​(Exception ex)  
      protected String generateAuthenticateHeader​(Exception ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.server.ServerWebExchange exchange)  
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleBindException​(org.springframework.validation.BindException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.server.ServerWebExchange exchange)
      Customize the response for BindException.
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleConversionNotSupported​(org.springframework.beans.ConversionNotSupportedException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.server.ServerWebExchange exchange)
      Customize the response for ConversionNotSupportedException.
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleExceptionInternal​(Exception ex, Object body, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.server.ServerWebExchange exchange)
      A single place to customize the response body of all exception types.
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleHttpMediaTypeNotSupported​(org.springframework.web.HttpMediaTypeNotSupportedException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.server.ServerWebExchange exchange)
      Customize the response for HttpMediaTypeNotSupportedException.
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleHttpRequestMethodNotSupported​(org.springframework.web.HttpRequestMethodNotSupportedException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.server.ServerWebExchange exchange)
      Customize the response for HttpRequestMethodNotSupportedException.
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleInternalServerError​(Exception ex, org.springframework.web.server.ServerWebExchange exchange)  
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleMethodArgumentNotValid​(org.springframework.web.bind.MethodArgumentNotValidException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.server.ServerWebExchange exchange)
      Customize the response for MethodArgumentNotValidException.
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleMissingPathVariable​(org.springframework.web.bind.MissingPathVariableException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.server.ServerWebExchange exchange)
      Customize the response for MissingPathVariableException.
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleMissingServletRequestParameter​(org.springframework.web.bind.MissingServletRequestParameterException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.server.ServerWebExchange exchange)
      Customize the response for MissingServletRequestParameterException.
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleMissingServletRequestPart​(org.springframework.web.multipart.support.MissingServletRequestPartException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.server.ServerWebExchange exchange)
      Customize the response for MissingServletRequestPartException.
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleNtsException​(Exception ex, org.springframework.web.server.ServerWebExchange exchange)  
      protected reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Object>> handleServletRequestBindingException​(org.springframework.web.bind.ServletRequestBindingException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.server.ServerWebExchange exchange)
      Customize the response for ServletRequestBindingException.