sleep.error
Interface RuntimeWarningWatcher
- All Known Implementing Classes:
- ConsoleImplementation
public interface RuntimeWarningWatcher
Runtime errors are caught by sleep. Examples of a runtime error include calling a function that doesn't exist, using an
operator that doesn't exist, or causing an exception in the underlying javacode. Whenever any of these events occurs
the event is isolated and turned into a ScriptWarning object. The Script Warning object is then propagated to all
registered warning watchers.
To create a runtime warning watcher:
public class Watchdog implements RuntimeWarningWatcher
{
public void processScriptWarning(ScriptWarning warning)
{
String message = warning.getMessage();
int lineNo = warning.getLineNumber();
String script = warning.getNameShort(); // name of script
}
}
To register a warning watcher:
script.addWarningWatcher(new Watchdog());
- See Also:
ScriptInstance
,
ScriptWarning
processScriptWarning
void processScriptWarning(ScriptWarning warning)
- fired when a runtime warning has occured. You might want to display this information to the user in some
manner as it may contain valuable information as to why something isn't working as it should