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

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

Introduction

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

Prototype

public static boolean isSSLCertificateFailure(Exception e) 

Source Link

Usage

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

public OrgsAndSpaces resolveSpaces(IRunnableContext context) {
    try {//from   w  w w  .  j a v  a  2 s.  co 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;
    }
}