本文整理汇总了Java中org.eclipse.core.runtime.IStatus.getException方法的典型用法代码示例。如果您正苦于以下问题:Java IStatus.getException方法的具体用法?Java IStatus.getException怎么用?Java IStatus.getException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.IStatus
的用法示例。
在下文中一共展示了IStatus.getException方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateBinaries
import org.eclipse.core.runtime.IStatus; //导入方法依赖的package包/类
private void validateBinaries() throws ExitCodeException {
IStatus status = nodeJsBinaryProvider.get().validate();
if (!status.isOK()) {
System.out.println(status.getMessage());
if (null != status.getException()) {
dumpThrowable(status.getException());
}
throw new ExitCodeException(EXITCODE_CONFIGURATION_ERROR, status.getMessage(), status.getException());
}
if (null != targetPlatformFile) {
status = npmBinaryProvider.get().validate();
if (!status.isOK()) {
System.out.println(status.getMessage());
if (null != status.getException()) {
dumpThrowable(status.getException());
}
throw new ExitCodeException(EXITCODE_CONFIGURATION_ERROR, status.getMessage(), status.getException());
}
}
}
示例2: getNotFoundError
import org.eclipse.core.runtime.IStatus; //导入方法依赖的package包/类
private static String getNotFoundError(CoreException ce) {
IStatus status = ce.getStatus();
Throwable t = status.getException();
if(t instanceof UnknownHostException ||
// XXX maybe a different msg ?
t instanceof SocketTimeoutException ||
t instanceof NoRouteToHostException ||
t instanceof ConnectException)
{
Bugzilla.LOG.log(Level.FINER, null, t);
return NbBundle.getMessage(BugzillaExecutor.class, "MSG_HOST_NOT_FOUND"); // NOI18N
}
String msg = getMessage(ce);
if(msg != null) {
msg = msg.trim().toLowerCase();
if(HTTP_ERROR_NOT_FOUND.equals(msg)) {
Bugzilla.LOG.log(Level.FINER, "returned error message [{0}]", msg); // NOI18N
return NbBundle.getMessage(BugzillaExecutor.class, "MSG_HOST_NOT_FOUND"); // NOI18N
}
}
return null;
}
示例3: handleCoreException
import org.eclipse.core.runtime.IStatus; //导入方法依赖的package包/类
/**
* Handles a core exception thrown during a testing environment operation
*/
private void handleCoreException(CoreException e) {
e.printStackTrace();
IStatus status = e.getStatus();
String message = e.getMessage();
if (status.isMultiStatus()) {
MultiStatus multiStatus = (MultiStatus) status;
IStatus[] children = multiStatus.getChildren();
StringBuffer buffer = new StringBuffer();
for (int i = 0, max = children.length; i < max; i++) {
IStatus child = children[i];
if (child != null) {
buffer.append(child.getMessage());
buffer.append(System.getProperty("line.separator"));//$NON-NLS-1$
Throwable childException = child.getException();
if (childException != null) {
childException.printStackTrace();
}
}
}
message = buffer.toString();
}
Assert.isTrue(false, "Core exception in testing environment: " + message); //$NON-NLS-1$
}
示例4: execute
import org.eclipse.core.runtime.IStatus; //导入方法依赖的package包/类
@Override
public void execute() throws CoreException, IOException, MalformedURLException {
LogUtils.logBugtrackingUsage(repositoryConnector.getConnectorKind(), "ISSUE_EDIT");
MylynSubmitTaskJob job = new MylynSubmitTaskJob(taskDataManager, repositoryConnector, taskRepository,
task, taskData, changedOldAttributes);
if (submitJobListener != null) {
job.addSubmitJobListener(submitJobListener);
}
Logger log = Logger.getLogger(this.getClass().getName());
if(log.isLoggable(Level.FINE)) {
log.log(
Level.FINE,
"executing SubmitJobCommand for task with id {0}:{1} ", //NOI18N
new Object[] { task.getTaskId(), taskRepository.getUrl() });
}
job.startJob(monitor);
IStatus status = job.getStatus();
rr = job.getResponse();
submittedTask = Accessor.getInstance().toNbTask(job.getTask());
if (status != null && status != Status.OK_STATUS) {
log.log(Level.INFO, "Command failed with status: {0}", status); //NOI18N
if (status.getException() instanceof CoreException) {
throw (CoreException) status.getException();
} else {
throw new CoreException(status);
}
}
}
示例5: getKenaiRedirectError
import org.eclipse.core.runtime.IStatus; //导入方法依赖的package包/类
private static String getKenaiRedirectError(CoreException ce) {
IStatus status = ce.getStatus();
if(status == null) {
return null;
}
Throwable cause = status.getException();
if(cause != null && cause instanceof RedirectException) {
String msg = cause.getMessage();
if(msg.contains(KENAI_LOGIN_REDIRECT)) {
Bugzilla.LOG.log(Level.FINER, "returned error message [{0}]", msg); // NOI18N
return NbBundle.getMessage(BugzillaExecutor.class, "MSG_INVALID_USERNAME_OR_PASSWORD"); // NOI18N
}
}
return null;
}
示例6: handleStatus
import org.eclipse.core.runtime.IStatus; //导入方法依赖的package包/类
/**
* Returnes true if the given commands status != ok
* @param cmd
* @param handleExceptions
* @return
* @throws CoreException
*/
private boolean handleStatus(SynchronizeQueryCommand cmd, boolean handleExceptions) throws CoreException {
IStatus status = cmd.getStatus();
if(status == null || status.isOK()) {
return false;
}
Bugzilla.LOG.log(Level.FINE, "command {0} returned status : {1}", new Object[] {cmd, status.getMessage()}); // NOI18N
if (status.getException() instanceof CoreException) {
throw (CoreException) status.getException();
}
boolean isHtml = false;
String errMsg = null;
if(status instanceof RepositoryStatus) {
RepositoryStatus rstatus = (RepositoryStatus) status;
errMsg = rstatus.getHtmlMessage();
isHtml = errMsg != null;
}
if(errMsg == null) {
errMsg = status.getMessage();
}
cmd.setErrorMessage(errMsg);
cmd.setFailed(true);
if(!handleExceptions) {
return true;
}
BugzillaConfiguration conf = repository.getConfiguration();
if(conf.isValid()) {
BugzillaVersion version = conf.getInstalledVersion();
if(version.compareMajorMinorOnly(BugzillaAutoupdate.SUPPORTED_BUGZILLA_VERSION) > 0) {
notifyErrorMessage(
NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_ERROR_WARNING", status.getMessage()) + "\n\n" +
NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_VERSION_WARNING1", version) + "\n" + // NOI18N
(true ? NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_VERSION_WARNING2") : "")); // NOI18N
return true;
}
}
if(isHtml) {
notifyHtmlMessage(errMsg, repository, true);
} else {
notifyErrorMessage(NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_ERROR_WARNING", errMsg)); // NOI18N
}
return true;
}