/** * Creates a more detailed message based on {@link RhinoException} thrown by rhino execution. The message will contain * a detailed description of the problem by inspecting the JSON value provided by exception. * * @param e * {@link RhinoException} thrown by rhino execution. * @return detailed string message. */ public static String createExceptionMessage(final RhinoException e) { StringBuffer message = new StringBuffer("Could not execute the script because: \n"); if (e instanceof JavaScriptException) { message.append(toJson(((JavaScriptException) e).getValue())); } else if (e instanceof EcmaError) { final EcmaError ecmaError = (EcmaError) e; message.append(String.format("Error message: %s at line: %s. \nSource: %s", ecmaError.getErrorMessage(), ecmaError.lineNumber(), ecmaError.lineSource())); } else { message.append(e.getMessage()); } return message.toString(); }
/** * Creates a more detailed message based on {@link RhinoException} thrown by rhino execution. The message will contain * a detailed description of the problem by inspecting the JSON value provided by exception. * * @param e * {@link RhinoException} thrown by rhino execution. * @return detailed string message. */ public static String createExceptionMessage(final RhinoException e) { StringBuffer message = new StringBuffer("Could not execute the script because: \n"); if (e instanceof JavaScriptException) { message.append(toJson(((JavaScriptException) e).getValue())); } else if (e instanceof EcmaError) { final EcmaError ecmaError = (EcmaError) e; message.append(String.format("Error message: %s at line: %s. \nSource: %s", ecmaError.getErrorMessage(), ecmaError.lineNumber(), ecmaError.lineSource())); } else { message.append(e.getMessage()); } return message.toString(); }
} catch (EcmaError ex2) { throw new QueryExecutionException(ex2.getErrorMessage()); throw new QueryExecutionException(parseErr.getErrorMessage());
} catch (EcmaError ex2) { throw new QueryExecutionException(ex2.getErrorMessage()); throw new QueryExecutionException(parseErr.getErrorMessage());
re = ee; errorName = ee.getName(); errorMsg = ee.getErrorMessage(); } else if (t instanceof WrappedException) { WrappedException we = (WrappedException)t;
re = ee; errorName = ee.getName(); errorMsg = ee.getErrorMessage(); } else if (t instanceof WrappedException) { WrappedException we = (WrappedException)t;
re = ee; errorName = ee.getName(); errorMsg = ee.getErrorMessage(); } else if (t instanceof WrappedException) { WrappedException we = (WrappedException)t;
re = ee; errorName = ee.getName(); errorMsg = ee.getErrorMessage(); } else if (t instanceof WrappedException) { WrappedException we = (WrappedException)t;
re = ee; errorName = ee.getName(); errorMsg = ee.getErrorMessage(); } else if (t instanceof WrappedException) { WrappedException we = (WrappedException)t;
re = ee; errorName = ee.getName(); errorMsg = ee.getErrorMessage(); } else if (t instanceof WrappedException) { WrappedException we = (WrappedException)t;
re = ee; type = TopLevel.NativeErrors.valueOf(ee.getName()); errorMsg = ee.getErrorMessage(); } else if (t instanceof WrappedException) { WrappedException we = (WrappedException)t;