Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.CoreException


  public CloudFoundryServer getCloudFoundryServer() throws CoreException {
    Server server = (Server) getServer();

    CloudFoundryServer cloudFoundryServer = (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class, null);
    if (cloudFoundryServer == null) {
      throw new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID, "Fail to load server")); //$NON-NLS-1$
    }
    return cloudFoundryServer;
  }
View Full Code Here


          credentials, url, cloudSpace.getOrgName(), cloudSpace.getSpaceName(), selfSigned)
          : CloudFoundryPlugin.getCloudFoundryClientFactory().getCloudFoundryOperations(credentials, url,
              selfSigned);
    }
    catch (MalformedURLException e) {
      throw new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID,
          "The server url " + serverURL + " is invalid: " + e.getMessage(), e)); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

      @Override
      protected void performOperation(IProgressMonitor monitor) throws CoreException {
        IStatus status = launch(monitor);
        if (!status.isOK()) {
          throw new CoreException(status);
        }
      }
    };
  }
View Full Code Here

        }

      }.run();
    }
    else {
      throw new CoreException(
          CloudFoundryPlugin
              .getErrorStatus("Unable to launch process because no process arguments were resolved when launching process for " //$NON-NLS-1$
                  + getLaunchName()));
    }
  }
View Full Code Here

        writer.flush();
        new FilePermissionChangeProcess(scriptFile, serviceCommand.getDisplayName()).run();
        return scriptFile;
      }
      else {
        throw new CoreException(CloudFoundryPlugin.getErrorStatus("Failed to create script file for: " //$NON-NLS-1$
            + serviceCommand.getDisplayName()));
      }
    }
    catch (IOException ioe) {
      throw CloudErrorUtil.toCoreException(ioe);
View Full Code Here

      }
      else {
        // Log other IO errors.
        String errorMessage = NLS.bind(Messages.ERROR_UNABLE_TO_COMMUNICATE_SERVER, e.getMessage());
        CloudFoundryPlugin.logError(errorMessage, e);
        return new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID, errorMessage));
      }
    }
    else {
      return checkRestException(e);
    }
View Full Code Here

  }

  public static CoreException toCoreException(Throwable e) {
    if (e instanceof CloudFoundryException) {
      if (((CloudFoundryException) e).getDescription() != null) {
        return new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID, NLS.bind("{0} ({1})", //$NON-NLS-1$
            ((CloudFoundryException) e).getDescription(), e.getMessage()), e));
      }
    }
    return new CoreException(new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID, NLS.bind(
        Messages.ERROR_PERFORMING_CLOUD_FOUNDRY_OPERATION, e.getMessage()), e));
  }
View Full Code Here

    }
    if (error != null) {
      if (error.getMessage() != null) {
        message += " - " + error.getMessage(); //$NON-NLS-1$
      }
      return new CoreException(CloudFoundryPlugin.getErrorStatus(message, error));
    }
    else {
      return new CoreException(CloudFoundryPlugin.getErrorStatus(message));
    }
  }
View Full Code Here

        String enhancedMessage = replaceMessage ? message : message + " - " + oldStatus.getMessage(); //$NON-NLS-1$
        newStatus = new Status(oldStatus.getSeverity(), oldStatus.getPlugin(), oldStatus.getCode(),
            enhancedMessage, oldStatus.getException());
      }

      return new CoreException(newStatus);
    }
    else {
      if (error instanceof CoreException) {
        return (CoreException) error;
      }
      else {
        return new CoreException(CloudFoundryPlugin.getErrorStatus(error));
      }
    }
  }
View Full Code Here

              return;
            }
            else if (exception != null) {

              if (exception instanceof CoreException) {
                CoreException coreException = (CoreException) exception;

                if (CloudErrorUtil.isNotFoundException(coreException)) {
                  display404Error(status);
                  return;
                }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.CoreException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.