Class 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 int PRECEDENCE  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.getlime.core.rest.model.base.response.ErrorResponse handleActivationException​(java.lang.Exception ex)
      Handle PowerAuthActivationException exceptions.
      io.getlime.core.rest.model.base.response.ErrorResponse handlePowerAuthEncryptionException​(java.lang.Exception ex)
      Handle PowerAuthEncryptionException exceptions.
      io.getlime.core.rest.model.base.response.ErrorResponse handlePowerAuthUpgradeException​(java.lang.Exception ex)
      Handle PowerAuthUpgradeException exceptions.
      io.getlime.security.powerauth.rest.api.model.exception.RecoveryErrorResponse handleRecoveryException​(java.lang.Exception ex)
      Handle PowerAuthRecoveryException exceptions.
      io.getlime.core.rest.model.base.response.ErrorResponse handleSecureVaultException​(java.lang.Exception ex)
      Handle PowerAuthSecureVaultException exceptions.
      io.getlime.core.rest.model.base.response.ErrorResponse handleUnauthorizedException​(java.lang.Exception ex)
      Handle PowerAuthAuthenticationException exceptions.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PowerAuthExceptionHandler

        public PowerAuthExceptionHandler()
    • Method Detail

      • 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​(java.lang.Exception 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​(java.lang.Exception 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​(java.lang.Exception 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​(java.lang.Exception 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​(java.lang.Exception 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​(java.lang.Exception ex)
        Handle PowerAuthUpgradeException exceptions.
        Parameters:
        ex - Exception instance.
        Returns:
        Error response.