Class PowerAuthExceptionHandler
java.lang.Object
io.getlime.security.powerauth.rest.api.spring.exception.PowerAuthExceptionHandler
@ControllerAdvice @Order(-100) public class PowerAuthExceptionHandler extends Object
Implementation of a PA2.0 Standard RESTful API exception handler.
- Author:
- Petr Dvorak, petr@wultra.com
-
Field Summary
Fields Modifier and Type Field Description static intPRECEDENCEPrecedence value that makes sure to apply the filters in the right order. -
Constructor Summary
Constructors Constructor Description PowerAuthExceptionHandler() -
Method Summary
Modifier and Type Method Description io.getlime.core.rest.model.base.response.ErrorResponsehandleActivationException(PowerAuthActivationException ex)Handle PowerAuthActivationException exceptions.io.getlime.core.rest.model.base.response.ErrorResponsehandlePowerAuthEncryptionException(PowerAuthEncryptionException ex)Handle PowerAuthEncryptionException exceptions.io.getlime.core.rest.model.base.response.ErrorResponsehandlePowerAuthUpgradeException(PowerAuthUpgradeException ex)Handle PowerAuthUpgradeException exceptions.io.getlime.security.powerauth.rest.api.model.exception.RecoveryErrorResponsehandleRecoveryException(PowerAuthRecoveryException ex)Handle PowerAuthRecoveryException exceptions.io.getlime.core.rest.model.base.response.ErrorResponsehandleSecureVaultException(PowerAuthSecureVaultException ex)Handle PowerAuthSecureVaultException exceptions.io.getlime.core.rest.model.base.response.ErrorResponsehandleUnauthorizedException(PowerAuthAuthenticationException ex)Handle PowerAuthAuthenticationException exceptions.
-
Field Details
-
PRECEDENCE
public static final int PRECEDENCEPrecedence value that makes sure to apply the filters in the right order.- See Also:
- Constant Field Values
-
-
Constructor Details
-
PowerAuthExceptionHandler
public PowerAuthExceptionHandler()
-
-
Method Details
-
handleUnauthorizedException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.spring.exception.PowerAuthAuthenticationException.class) @ResponseStatus(UNAUTHORIZED) @ResponseBody public io.getlime.core.rest.model.base.response.ErrorResponse handleUnauthorizedException(PowerAuthAuthenticationException ex)Handle PowerAuthAuthenticationException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-
handleActivationException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.spring.exception.PowerAuthActivationException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public io.getlime.core.rest.model.base.response.ErrorResponse handleActivationException(PowerAuthActivationException ex)Handle PowerAuthActivationException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-
handleRecoveryException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.spring.exception.PowerAuthRecoveryException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public io.getlime.security.powerauth.rest.api.model.exception.RecoveryErrorResponse handleRecoveryException(PowerAuthRecoveryException ex)Handle PowerAuthRecoveryException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-
handleSecureVaultException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.spring.exception.PowerAuthSecureVaultException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public io.getlime.core.rest.model.base.response.ErrorResponse handleSecureVaultException(PowerAuthSecureVaultException ex)Handle PowerAuthSecureVaultException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-
handlePowerAuthEncryptionException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.spring.exception.PowerAuthEncryptionException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public io.getlime.core.rest.model.base.response.ErrorResponse handlePowerAuthEncryptionException(PowerAuthEncryptionException ex)Handle PowerAuthEncryptionException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-
handlePowerAuthUpgradeException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.spring.exception.PowerAuthUpgradeException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public io.getlime.core.rest.model.base.response.ErrorResponse handlePowerAuthUpgradeException(PowerAuthUpgradeException ex)Handle PowerAuthUpgradeException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-