/** * Handles an error state specified by the status. The collection of all logged status * objects can be accessed using <code>getStatus()</code>. * * @param error a status detailing the error condition */ public void error(IStatus error) { status.add(error); }
public MultiStatusBuilder addAll(List<Throwable> exceptions) { for (Throwable t : exceptions) { Status status = new Status(IStatus.ERROR, _pluginId, t.getMessage(), t); _retval.add(status); } return this; }
/** * @see ErrorHandler#fatalError(SAXParseException) */ @Override public void fatalError(SAXParseException error) throws SAXException { // ensure a null value is not passed as message to Status constructor (bug 42782) String message = error.getMessage(); if (project != null) message = NLS.bind(Messages.resources_readMeta, project.getName()); problems.add(new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_READ_METADATA, message == null ? "" : message, error)); //$NON-NLS-1$ throw error; }
protected void log(Exception ex) { String message = ex.getMessage(); if (project != null) message = NLS.bind(Messages.resources_readMeta, project.getName()); problems.add(new Status(IStatus.WARNING, ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_READ_METADATA, message == null ? "" : message, ex)); //$NON-NLS-1$ }
private void addStatus(IStatus status) { if (fStatus == null) { fStatus = new MultiStatus(LaunchingPlugin.ID_PLUGIN, 0, LaunchingMessages.VMDefinitionsContainer_10, null); } fStatus.add(status); }
/** * Logs an exception */ protected synchronized void addException(String message) { if (errors == null) { String msg = Messages.WM_errors; errors = new MultiStatus(ResourcesPlugin.PI_RESOURCES, 1, msg, null); } errors.add(new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, 1, message, null)); }
@Override public void handleException(Throwable exception) { if (exception instanceof CoreException) errors.add(((CoreException) exception).getStatus()); else errors.add(new ResourceStatus(IResourceStatus.INTERNAL_ERROR, project.getFullPath(), NLS.bind(Messages.resources_errorNature, natureID), exception)); } };
private void endSnapshotLocation(String elementName) { if (elementName.equals(SNAPSHOT_LOCATION)) { String location = charBuffer.toString().trim(); try { projectDescription.setSnapshotLocationURI(new URI(location)); } catch (URISyntaxException e) { String msg = NLS.bind(Messages.projRead_badSnapshotLocation, location); problems.add(new Status(IStatus.WARNING, ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_READ_METADATA, msg, e)); } state = S_PROJECT_DESC; } }
/** * Merges the provided <code>newStatus</code> into the * <code>multiStatus</code>. * * @param multiStatus * @param newStatus */ /* package */void mergeStatus(MultiStatus multiStatus, IStatus newStatus) { if (!newStatus.isOK()) { multiStatus.add(newStatus); } }
/** * Merges the provided <code>newStatus</code> into the * <code>multiStatus</code>. * * @param multiStatus * @param newStatus */ /* package */void mergeStatus(MultiStatus multiStatus, IStatus newStatus) { if (!newStatus.isOK()) { multiStatus.add(newStatus); } }
@Override public IStatus toStatus() { MultiStatus result = new MultiStatus(DirectorActivator.PI_DIRECTOR, 1, Messages.Explanation_unsatisfied, null); final String fromString = patch.toString() + ' ' + getUserReadableName(iu); result.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Explanation_fromPatch, fromString))); result.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Explanation_to, req))); return result; }
private void addStatus(IStatus status) { if (fStatus == null) { fStatus = new MultiStatus(LaunchingPlugin.ID_PLUGIN, 0, LaunchingMessages.VMDefinitionsContainer_10, null); } fStatus.add(status); }
/** * Merges the provided <code>newStatus</code> into the * <code>multiStatus</code>. * * @param multiStatus * @param newStatus */ /* package */void mergeStatus(MultiStatus multiStatus, IStatus newStatus) { if (!newStatus.isOK()) { multiStatus.add(newStatus); } }
@Override public void handleException(Throwable exception) { if (exception instanceof CoreException) errors.add(((CoreException) exception).getStatus()); else errors.add(new ResourceStatus(IResourceStatus.INTERNAL_ERROR, project.getFullPath(), NLS.bind(Messages.resources_errorNature, natureID), exception)); } };
@Override public void handleException(Throwable exception) { if (exception instanceof CoreException) status.add(((CoreException) exception).getStatus()); else status.add(new ResourceStatus(IResourceStatus.INTERNAL_ERROR, project.getFullPath(), NLS.bind(Messages.resources_natureDeconfig, natureID), exception)); } };
/** * Convenience method for handling generic exceptions. * * @param exception * @param errorMessage */ public static void handleException(final Bundle bundle, final Exception exception, final String errorMessage) { final MultiStatus errorStatus = getServiceInfo(bundle, exception); final IStatus status = new Status(IStatus.ERROR, bundle.getSymbolicName(), IStatus.ERROR, errorMessage, exception); errorStatus.add(status); Platform.getLog(bundle).log(status); }
protected boolean copyProperties(Resource target, Resource destination) { try { target.getPropertyManager().copy(target, destination, IResource.DEPTH_ZERO); return true; } catch (CoreException e) { status.add(e.getStatus()); return false; } }
protected final void addToStatus(CoreException ex) { IStatus status= ex.getStatus(); String message= ex.getLocalizedMessage(); if (message == null || message.length() < 1) { message= JarPackagerMessages.JarFileExportOperation_coreErrorDuringExport; status= new Status(status.getSeverity(), status.getPlugin(), status.getCode(), message, ex); } fStatus.add(status); } }
public static void logErrorStatus(String message, IStatus status) { if (status == null) { logErrorMessage(message); return; } MultiStatus multi= new MultiStatus(EditorsUI.PLUGIN_ID, IEditorsStatusConstants.INTERNAL_ERROR, message, null); multi.add(status); log(multi); }
private IStatus saveWorkbenchState(IMemento memento) { MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.Workbench_problemsSaving, null); // TODO: Currently we store the editors history only. Add more if needed result.add(getEditorHistory().saveState( memento.createChild(IWorkbenchConstants.TAG_MRU_LIST))); return result; }