Interface RestApiExceptionMapper


  • @Validated
    public interface RestApiExceptionMapper
    Maps the error response into a RestApiException.
    Author:
    Christian Bremer
    • Method Detail

      • getApiPaths

        @NotNull
        @NotNull List<String> getApiPaths()
        Gets the paths this mapper is responsible for.
        Returns:
        the list of paths (typically ant paths)
      • build

        @NotNull
        @NotNull org.bremersee.exception.model.RestApiException build​(@NotNull
                                                                      @NotNull Throwable exception,
                                                                      @Nullable
                                                                      String requestPath,
                                                                      @Nullable
                                                                      Object handler)
        Build the exception model from the exception, the requested path and an handler. Typically the handler is of type HandlerMethod.
        Parameters:
        exception - the exception (required)
        requestPath - the requested path (optional)
        handler - the handler (optional)
        Returns:
        the rest api exception
      • detectHttpStatus

        @NotNull
        @NotNull org.springframework.http.HttpStatus detectHttpStatus​(@NotNull
                                                                      @NotNull Throwable exception,
                                                                      @Nullable
                                                                      Object handler)
        Detects the http status.
        Parameters:
        exception - the exception (required)
        handler - the handler (optional)
        Returns:
        the http status