wro4j-extensions/src/main/java/ro/isdc/wro/extensions/script/RhinoUtils.java
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();
  }
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.