Class ApiControllerAdvice

java.lang.Object
se.swedenconnect.bankid.idp.authn.error.ApiControllerAdvice

@RestControllerAdvice(annotations=ApiController.class) public class ApiControllerAdvice extends Object
Controller advice for api error handling.
Author:
Martin Lindström, Felix Hellman
  • Field Details

  • Constructor Details

    • ApiControllerAdvice

      public ApiControllerAdvice()
  • Method Details

    • handleException

      @ExceptionHandler(io.github.resilience4j.circuitbreaker.CallNotPermittedException.class) public ResponseEntity<String> handleException()
      Handles exception for CallNotPermitted (resilience4j).
      Returns:
      an error response with a randomized backoff timer for the frontend to handle
    • defaultHandler

      Handles uncaught exceptions for /api routes.
      Parameters:
      e - uncaught exception to handle
      Returns:
      redirect to error view (as json)