public class ToolErrorReporter extends Object implements ErrorReporter
Currently used by both the shell and the compiler.
| Constructor and Description |
|---|
ToolErrorReporter(boolean reportWarnings) |
ToolErrorReporter(boolean reportWarnings,
PrintStream err) |
| Modifier and Type | Method and Description |
|---|---|
void |
error(String message,
String sourceName,
int line,
String lineSource,
int lineOffset)
Report an error.
|
static String |
getMessage(String messageId)
Look up the message corresponding to messageId in the
org.htmlunit.corejs.javascript.tools.shell.resources.Messages property file.
|
static String |
getMessage(String messageId,
Object[] args) |
static String |
getMessage(String messageId,
Object arg1,
Object arg2) |
static String |
getMessage(String messageId,
String argument) |
boolean |
hasReportedError() |
boolean |
isReportingWarnings() |
static void |
reportException(ErrorReporter er,
RhinoException ex) |
void |
reportException(RhinoException ex) |
EvaluatorException |
runtimeError(String message,
String sourceName,
int line,
String lineSource,
int lineOffset)
Creates an EvaluatorException that may be thrown.
|
void |
setIsReportingWarnings(boolean reportWarnings) |
void |
warning(String message,
String sourceName,
int line,
String lineSource,
int lineOffset)
Report a warning.
|
public ToolErrorReporter(boolean reportWarnings)
public ToolErrorReporter(boolean reportWarnings,
PrintStream err)
public static String getMessage(String messageId)
public void warning(String message, String sourceName, int line, String lineSource, int lineOffset)
ErrorReporterThe implementing class may choose to ignore the warning if it desires.
warning in interface ErrorReportermessage - a String describing the warningsourceName - a String describing the JavaScript source where the warning occurred;
typically a filename or URLline - the line number associated with the warninglineSource - the text of the line (may be null)lineOffset - the offset into lineSource where problem was detectedpublic void error(String message, String sourceName, int line, String lineSource, int lineOffset)
ErrorReporterThe implementing class is free to throw an exception if it desires.
If execution has not yet begun, the JavaScript engine is free to find additional errors rather than terminating the translation. It will not execute a script that had errors, however.
error in interface ErrorReportermessage - a String describing the errorsourceName - a String describing the JavaScript source where the error occurred;
typically a filename or URLline - the line number associated with the errorlineSource - the text of the line (may be null)lineOffset - the offset into lineSource where problem was detectedpublic EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset)
ErrorReporterruntimeErrors, unlike errors, will always terminate the current script.
runtimeError in interface ErrorReportermessage - a String describing the errorsourceName - a String describing the JavaScript source where the error occurred;
typically a filename or URLline - the line number associated with the errorlineSource - the text of the line (may be null)lineOffset - the offset into lineSource where problem was detectedpublic boolean hasReportedError()
public boolean isReportingWarnings()
public void setIsReportingWarnings(boolean reportWarnings)
public static void reportException(ErrorReporter er, RhinoException ex)
public void reportException(RhinoException ex)
Copyright © 2025 HtmlUnit. All rights reserved.