org.mozilla.javascript.EcmaError.getErrorMessage()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 JavaScript  
字(3.6k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.mozilla.javascript.EcmaError.getErrorMessage()方法的一些代码示例,展示了EcmaError.getErrorMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EcmaError.getErrorMessage()方法的具体详情如下:
包路径:org.mozilla.javascript.EcmaError
类名称:EcmaError
方法名:getErrorMessage

EcmaError.getErrorMessage介绍

[英]Gets the message corresponding to the error. See ECMA edition 3, 15.11.7.10.
[中]获取与错误对应的消息。见ECMA第3版,15.11.7.10。

代码示例

代码示例来源:origin: alexo/wro4j

/**
 * 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();
}

代码示例来源:origin: ro.isdc.wro4j/wro4j-extensions

/**
 * 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();
}

代码示例来源:origin: couchbase/CouchbaseMock

} catch (EcmaError ex2) {
  throw new QueryExecutionException(ex2.getErrorMessage());
throw new QueryExecutionException(parseErr.getErrorMessage());

代码示例来源:origin: com.couchbase.mock/CouchbaseMock

} catch (EcmaError ex2) {
  throw new QueryExecutionException(ex2.getErrorMessage());
throw new QueryExecutionException(parseErr.getErrorMessage());

代码示例来源:origin: geogebra/geogebra

re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
  WrappedException we = (WrappedException)t;

代码示例来源:origin: io.apigee/rhino

re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
  WrappedException we = (WrappedException)t;

代码示例来源:origin: com.github.tntim96/rhino

re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
  WrappedException we = (WrappedException)t;

代码示例来源:origin: ro.isdc.wro4j/rhino

re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
  WrappedException we = (WrappedException)t;

代码示例来源:origin: com.sun.phobos/phobos-rhino

re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
  WrappedException we = (WrappedException)t;

代码示例来源:origin: rhino/js

re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
  WrappedException we = (WrappedException)t;

代码示例来源:origin: geogebra/geogebra

re = ee;
  type = TopLevel.NativeErrors.valueOf(ee.getName());
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
  WrappedException we = (WrappedException)t;

相关文章