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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionHandles uncaught exceptions for /api routes.Handles exception for CallNotPermitted (resilience4j).
-
Field Details
-
ERROR_TECHNICAL_DIFFICULTIES_BUSY
- See Also:
-
-
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
@ExceptionHandler(java.lang.Exception.class) public ResponseEntity<UserErrorResponse> defaultHandler(Exception e) Handles uncaught exceptions for /api routes.- Parameters:
e
- uncaught exception to handle- Returns:
- redirect to error view (as json)
-