Package org.mozilla.javascript
Interface ErrorReporter
- All Known Subinterfaces:
IdeErrorReporter
- All Known Implementing Classes:
ErrorCollector
public interface ErrorReporter
This is interface defines a protocol for the reporting of errors during JavaScript translation or
execution.
- Author:
- Norris Boyd
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Report an error.runtimeError
(String message, String sourceName, int line, String lineSource, int lineOffset) Creates an EvaluatorException that may be thrown.void
Report a warning.
-
Method Details
-
warning
Report a warning.The implementing class may choose to ignore the warning if it desires.
- Parameters:
message
- 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 detected
-
error
Report an error.The 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.
- Parameters:
message
- 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 detected
-
runtimeError
EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset) Creates an EvaluatorException that may be thrown.runtimeErrors, unlike errors, will always terminate the current script.
- Parameters:
message
- 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 detected- Returns:
- an EvaluatorException that will be thrown.
-