if (re instanceof WrappedException) {
// Make sure we're not printing the "Wrapped ...Exception:" part
writer.println(((WrappedException) re).getWrappedException()
.getMessage());
} else {
writer.println(re.details());
}
String[] stackTrace = re.getScriptStackTrace().split("\\r\\n|\\n|\\r");
String sourceName = re.sourceName();
if (sourceName != null) {
int lineNumber = re.lineNumber();