public Throwable getException() { return throwable != null ? throwable : diagnostic.getException(); }
public Throwable getException() { return diagnostic.getException(); }
public DiagnosticException(Diagnostic diagnostic) { super(diagnostic.getMessage(), diagnostic.getException()); this.diagnostic = diagnostic; }
protected void printDiagnostic(StringBuffer out, String prefix, Diagnostic d) { final String indent = " "; out.append(prefix); out.append(d); if (d.getChildren().size() > 0 || d.getException() != null) { out.append(" {\n"); String prefix2 = prefix + indent; if (d.getException() != null) { out.append(prefix2); ByteArrayOutputStream s = new ByteArrayOutputStream(); PrintWriter pw = new PrintWriter(s); d.getException().printStackTrace(pw); pw.flush(); out.append(s.toString()); out.append("\n"); } for (Diagnostic c : d.getChildren()) printDiagnostic(out, prefix2, c); out.append(prefix); out.append("}\n"); } else out.append("\n"); }
protected void printDiagnostic(StringBuffer out, String prefix, Diagnostic d) { final String indent = " "; out.append(prefix); out.append(d); if (d.getChildren().size() > 0 || d.getException() != null) { out.append(" {\n"); String prefix2 = prefix + indent; if (d.getException() != null) { out.append(prefix2); ByteArrayOutputStream s = new ByteArrayOutputStream(); PrintWriter pw = new PrintWriter(s); d.getException().printStackTrace(pw); pw.flush(); out.append(s.toString()); out.append("\n"); } for (Diagnostic c : d.getChildren()) printDiagnostic(out, prefix2, c); out.append(prefix); out.append("}\n"); } else out.append("\n"); }
protected void printDiagnostic(StringBuffer out, String prefix, Diagnostic d) { final String indent = " "; out.append(prefix); out.append(d); if (d.getChildren().size() > 0 || d.getException() != null) { out.append(" {\n"); String prefix2 = prefix + indent; if (d.getException() != null) { out.append(prefix2); ByteArrayOutputStream s = new ByteArrayOutputStream(); PrintWriter pw = new PrintWriter(s); d.getException().printStackTrace(pw); pw.flush(); out.append(s.toString()); out.append("\n"); } for (Diagnostic c : d.getChildren()) printDiagnostic(out, prefix2, c); out.append(prefix); out.append("}\n"); } else out.append("\n"); }
@Override public void add(final Diagnostic diagnostic) { int _severity = diagnostic.getSeverity(); boolean _equals = (_severity == Diagnostic.ERROR); if (_equals) { String _name = grammar.getName(); String _plus = ("Validation Error in " + _name); final String grammarName = (_plus + ": "); Throwable _exception = diagnostic.getException(); boolean _tripleEquals = (_exception == null); if (_tripleEquals) { String _message = diagnostic.getMessage(); String _plus_1 = (grammarName + _message); throw new IllegalStateException(_plus_1); } else { String _message_1 = diagnostic.getMessage(); String _plus_2 = (grammarName + _message_1); Throwable _exception_1 = diagnostic.getException(); throw new IllegalStateException(_plus_2, _exception_1); } } }