public static void reportException(ErrorReporter er, RhinoException ex) { if (er instanceof ToolErrorReporter) { ((ToolErrorReporter) er).reportException(ex); } else { String msg = getExceptionMessage(ex); er.error(msg, ex.sourceName(), ex.lineNumber(), ex.lineSource(), ex.columnNumber()); } }
public void reportException(RhinoException ex) { if (ex instanceof WrappedException) { WrappedException we = (WrappedException) ex; we.printStackTrace(err); } else { String lineSeparator = SecurityUtilities.getSystemProperty("line.separator"); String msg = getExceptionMessage(ex) + lineSeparator + ex.getScriptStackTrace(); reportErrorMessage( msg, ex.sourceName(), ex.lineNumber(), ex.lineSource(), ex.columnNumber(), false); } }
private static String getExceptionMessage(RhinoException ex) { String msg; if (ex instanceof JavaScriptException) { msg = getMessage("msg.uncaughtJSException", ex.details()); } else if (ex instanceof EcmaError) { msg = getMessage("msg.uncaughtEcmaError", ex.details()); } else if (ex instanceof EvaluatorException) { msg = ex.details(); } else { msg = ex.toString(); } return msg; }