protected void handleAuthenticationException ( final Throwable ex , final String name , final AuthenticationBuilder builder ) { var e = ex ; if ( ex instanceof UndeclaredThrowableException ) { e = ( ( UndeclaredThrowableException ) ex ) . getUndeclaredThrowable ( ) ; } LOGGER . trace ( e . getMessage ( ) , e ) ; val msg = new StringBuilder ( StringUtils . defaultString ( e . getMessage ( ) ) ) ; if ( e . getCause ( ) != null ) { msg . append ( " / " ) . append ( e . getCause ( ) . getMessage ( ) ) ; } if ( e instanceof GeneralSecurityException ) { LOGGER . debug ( "[{}] exception details: [{}]." , name , msg ) ; builder . addFailure ( name , e ) ; } else { LOGGER . error ( "[{}]: [{}]" , name , msg ) ; builder . addFailure ( name , e ) ; } }
Handle authentication exception .