Search in sources :

Example 1 with IResourceStatus

use of org.eclipse.core.resources.IResourceStatus in project che by eclipse.

the class ResourceException method printStackTrace.

/**
	 * Prints a stack trace out for the exception, and
	 * any nested exception that it may have embedded in
	 * its Status object.
	 */
@Override
public void printStackTrace(PrintWriter output) {
    synchronized (output) {
        IStatus status = getStatus();
        if (status.getException() != null) {
            //$NON-NLS-1$
            String path = "()";
            if (status instanceof IResourceStatus)
                //$NON-NLS-1$ //$NON-NLS-2$
                path = "(" + ((IResourceStatus) status).getPath() + ")";
            //$NON-NLS-1$ //$NON-NLS-2$
            output.print(getClass().getName() + path + "[" + status.getCode() + "]: ");
            status.getException().printStackTrace(output);
        } else
            super.printStackTrace(output);
    }
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) IResourceStatus(org.eclipse.core.resources.IResourceStatus)

Example 2 with IResourceStatus

use of org.eclipse.core.resources.IResourceStatus in project che by eclipse.

the class ResourceException method printStackTrace.

/**
	 * Prints a stack trace out for the exception, and
	 * any nested exception that it may have embedded in
	 * its Status object.
	 */
@Override
public void printStackTrace(PrintStream output) {
    synchronized (output) {
        IStatus status = getStatus();
        if (status.getException() != null) {
            //$NON-NLS-1$
            String path = "()";
            if (status instanceof IResourceStatus)
                //$NON-NLS-1$ //$NON-NLS-2$
                path = "(" + ((IResourceStatus) status).getPath() + ")";
            //$NON-NLS-1$ //$NON-NLS-2$
            output.print(getClass().getName() + path + "[" + status.getCode() + "]: ");
            status.getException().printStackTrace(output);
        } else
            super.printStackTrace(output);
    }
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) IResourceStatus(org.eclipse.core.resources.IResourceStatus)

Aggregations

IResourceStatus (org.eclipse.core.resources.IResourceStatus)2 IStatus (org.eclipse.core.runtime.IStatus)2