/** * Return an error status that can be used to report the specified exception. * * @param message the message that should be used in the status * @param e the exception to be reported * @return a status that can be used to describe the exception */ protected IStatus getErrorStatus(String message, ProvisionException e) { if (message == null) if (e == null) message = NLS.bind(Messages.ProvisioningJob_GenericErrorStatusMessage, getName()); else message = e.getLocalizedMessage(); return new Status(IStatus.ERROR, Activator.ID, message, e); }
/** * Return an error status that can be used to report the specified exception. * * @param message the message that should be used in the status * @param e the exception to be reported * @return a status that can be used to describe the exception */ protected IStatus getErrorStatus(String message, ProvisionException e) { if (message == null) if (e == null) message = NLS.bind(Messages.ProvisioningJob_GenericErrorStatusMessage, getName()); else message = e.getLocalizedMessage(); return new Status(IStatus.ERROR, Activator.ID, message, e); }
protected Object[] fetchChildren(Object o, IProgressMonitor monitor) { SubMonitor sub = SubMonitor.convert(monitor, 200); // Ensure the repository is loaded using the monitor, so we respond to cancelation. // Otherwise, a non-loaded repository could be loaded in the query provider without a monitor. // If the load fails, return an explanation element. try { getMetadataRepository(sub.newChild(100)); //only invoke super if we successfully loaded the repository return super.fetchChildren(o, sub.newChild(100)); } catch (ProvisionException e) { getProvisioningUI().getRepositoryTracker().reportLoadFailure(location, e); // TODO see https://bugs.eclipse.org/bugs/show_bug.cgi?id=276784 return new Object[] {new EmptyElementExplanation(this, IStatus.ERROR, e.getLocalizedMessage(), "")}; //$NON-NLS-1$ } }