private static void validateCredentials ( ) { try { Account . get ( ) . getAccountInfo ( ) ; } catch ( Exception e ) { if ( e instanceof AppPlatformException ) { AppPlatformException appEx = ( AppPlatformException ) e ; if ( appEx . getStatus ( ) == 401 ) { throw new InvalidCredentialsException ( ) ; } } else { throw new RuntimeException ( e ) ; } } }
Validate if the credentials are set and has access to catapult