Class PowerAuthExceptionHandler
java.lang.Object
io.getlime.security.powerauth.rest.api.spring.exception.PowerAuthExceptionHandler
@ControllerAdvice
@Order(-100)
public class PowerAuthExceptionHandler
extends java.lang.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 intPRECEDENCE -
Constructor Summary
Constructors Constructor Description PowerAuthExceptionHandler() -
Method Summary
Modifier and Type Method Description io.getlime.core.rest.model.base.response.ErrorResponsehandleActivationException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthActivationException ex)Handle PowerAuthActivationException exceptions.io.getlime.core.rest.model.base.response.ErrorResponsehandlePowerAuthEncryptionException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthEncryptionException ex)Handle PowerAuthEncryptionException exceptions.io.getlime.core.rest.model.base.response.ErrorResponsehandlePowerAuthUpgradeException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthUpgradeException ex)Handle PowerAuthUpgradeException exceptions.io.getlime.security.powerauth.rest.api.model.exception.RecoveryErrorResponsehandleRecoveryException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthRecoveryException ex)Handle PowerAuthRecoveryException exceptions.io.getlime.core.rest.model.base.response.ErrorResponsehandleSecureVaultException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthSecureVaultException ex)Handle PowerAuthSecureVaultException exceptions.io.getlime.core.rest.model.base.response.ErrorResponsehandleUnauthorizedException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthAuthenticationException ex)Handle PowerAuthAuthenticationException exceptions.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
PRECEDENCE
public static final int PRECEDENCE- See Also:
- Constant Field Values
-
-
Constructor Details
-
PowerAuthExceptionHandler
public PowerAuthExceptionHandler()
-
-
Method Details
-
handleUnauthorizedException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthAuthenticationException.class) @ResponseStatus(UNAUTHORIZED) @ResponseBody public io.getlime.core.rest.model.base.response.ErrorResponse handleUnauthorizedException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthAuthenticationException ex)Handle PowerAuthAuthenticationException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-
handleActivationException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthActivationException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public io.getlime.core.rest.model.base.response.ErrorResponse handleActivationException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthActivationException ex)Handle PowerAuthActivationException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-
handleRecoveryException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthRecoveryException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public io.getlime.security.powerauth.rest.api.model.exception.RecoveryErrorResponse handleRecoveryException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthRecoveryException ex)Handle PowerAuthRecoveryException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-
handleSecureVaultException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthSecureVaultException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public io.getlime.core.rest.model.base.response.ErrorResponse handleSecureVaultException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthSecureVaultException ex)Handle PowerAuthSecureVaultException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-
handlePowerAuthEncryptionException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthEncryptionException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public io.getlime.core.rest.model.base.response.ErrorResponse handlePowerAuthEncryptionException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthEncryptionException ex)Handle PowerAuthEncryptionException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-
handlePowerAuthUpgradeException
@ExceptionHandler(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthUpgradeException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public io.getlime.core.rest.model.base.response.ErrorResponse handlePowerAuthUpgradeException(io.getlime.security.powerauth.rest.api.base.exception.PowerAuthUpgradeException ex)Handle PowerAuthUpgradeException exceptions.- Parameters:
ex- Exception instance.- Returns:
- Error response.
-