}
if (e instanceof LineConfigException)
return (LineConfigException) e;
else if (e instanceof LineCompileException) {
return new LineConfigException(e.getMessage(), e);
}
else if (e instanceof ConfigException
&& e.getMessage() != null
&& filename != null) {
String sourceLines = getSourceLines(systemId, line);
return new LineConfigException(filename, line,
e.getMessage() + sourceLines,
e);
}
else if (e instanceof CompileException && e.getMessage() != null) {
return new LineConfigException(filename, line, e);
}
else {
String sourceLines = getSourceLines(systemId, line);
String msg = filename + ":" + line + ": " + e + sourceLines;
if (e instanceof RuntimeException) {
throw new LineConfigException(msg, e);
}
else if (e instanceof Error) {
// server/1711
throw new LineConfigException(msg, e);
// throw (Error) e;
}
else
return new LineConfigException(msg, e);
}
}