/** * Creates a JETException with the embedded exception. */ public JETException(Throwable exception) { super (BasicDiagnostic.toDiagnostic(exception)); }
/** * Creates a JETException with the embedded exception. */ public JETException(Throwable exception) { super (BasicDiagnostic.toDiagnostic(exception)); }
public List<Diagnostic> basicGetChildren() { if (wrappedChildren == null) { IStatus[] children = status.getChildren(); if (children.length == 0) { wrappedChildren = new ArrayList<Diagnostic>(); } else { wrappedChildren = new ArrayList<Diagnostic>(children.length); for (IStatus child : children) { wrappedChildren.add(toDiagnostic(child)); } } } return wrappedChildren; }
public static Diagnostic toDiagnostic(Throwable throwable) { if (throwable instanceof org.eclipse.core.runtime.CoreException) { IStatus status = ((org.eclipse.core.runtime.CoreException)throwable).getStatus(); DiagnosticWrapper wrapperDiagnostic = new DiagnosticWrapper(status); Throwable cause = throwable.getCause(); if (cause != null && cause != throwable) { wrapperDiagnostic.basicGetChildren().add(BasicDiagnostic.toDiagnostic(cause)); } return wrapperDiagnostic; } return null; } }
return toDiagnostic(throwable.getCause()); basicDiagnostic.add(toDiagnostic(throwable));
/** * Converts the given exception to a <code>Diagnostic</code>. The <code>currentMessage</code>, if non-null, should * describe what was being done when the exception occurred, and will be used in forming the diagnostic's message. */ protected Diagnostic toDiagnostic(Exception exception, String currentMessage) { CodeGenEcorePlugin.INSTANCE.log(exception); currentMessage = currentMessage != null ? CodeGenEcorePlugin.INSTANCE.getString("_UI_GenerateException_diagnostic", new Object[] { currentMessage }) : CodeGenEcorePlugin.INSTANCE.getString("_UI_GenericGenerateException_diagnostic"); BasicDiagnostic diagnostic = new BasicDiagnostic(CodeGenEcorePlugin.ID, 0, currentMessage, null); //DMS this doesn't really produce nice output. // diagnostic.add(BasicDiagnostic.toDiagnostic(exception)); return diagnostic; }
/** * Converts the given exception to a <code>Diagnostic</code>. The <code>currentMessage</code>, if non-null, should * describe what was being done when the exception occurred, and will be used in forming the diagnostic's message. */ protected Diagnostic toDiagnostic(Exception exception, String currentMessage) { if (!(exception instanceof OperationCanceledException)) { CodeGenEcorePlugin.INSTANCE.log(exception); } currentMessage = currentMessage != null ? CodeGenEcorePlugin.INSTANCE.getString("_UI_GenerateException_diagnostic", new Object[] { currentMessage }) : CodeGenEcorePlugin.INSTANCE.getString("_UI_GenericGenerateException_diagnostic"); BasicDiagnostic diagnostic = new BasicDiagnostic(CodeGenEcorePlugin.ID, 0, currentMessage, null); diagnostic.add(BasicDiagnostic.toDiagnostic(exception)); return diagnostic; }
if (resourceDiagnostic instanceof Throwable) diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic); if (resourceDiagnostic instanceof Throwable) diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic);
if (resourceDiagnostic instanceof Throwable) diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic); if (resourceDiagnostic instanceof Throwable) diagnostic = BasicDiagnostic.toDiagnostic((Throwable)resourceDiagnostic);
public static Diagnostic createErrorDiagnostic(Throwable throwable, boolean showErrorDialog) Diagnostic diagnostic = BasicDiagnostic.toDiagnostic(throwable); if (showErrorDialog)
BasicDiagnostic.toDiagnostic(runtimeException) : new BasicDiagnostic( Diagnostic.ERROR,