Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client CFExceptions isAuthFailure

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client CFExceptions isAuthFailure

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client CFExceptions isAuthFailure.

Prototype

public static boolean isAuthFailure(Exception e) 

Source Link

Usage

From source file:org.springframework.ide.eclipse.boot.dash.cloudfoundry.CloudFoundryTargetWizardModel.java

public OrgsAndSpaces resolveSpaces(IRunnableContext context) {
    try {/*from  ww w  .ja va  2 s  .c o  m*/
        boolean toFetchSpaces = true;
        OrgsAndSpaces spaces = getCloudSpaces(createTargetProperties(toFetchSpaces), context);
        resolvedSpaces.setValue(spaces);
        spaceResolutionStatus.setValue(ValidationResult.OK);
        return resolvedSpaces.getValue();
    } catch (Exception e) {
        if (CFExceptions.isAuthFailure(e) || CFExceptions.isSSLCertificateFailure(e)) {
            //don't log, its expected if user just typed bad password,
            //or didn't check ssl box when they should have.
        } else {
            Log.log(e);
        }
        resolvedSpaces.setValue(null);
        spaceResolutionStatus.setValue(ValidationResult.error(ExceptionUtil.getMessage(e)));
        return null;
    }
}