If script warnings are enabled in the user preferences,
prints a warning that a feature has been deprecated
and may be removed in the future. The message often suggests what to
use instead of the deprecated feature. If stackFrame
is
specified, it indicates the relative call site from which the warning
will appear to have come. For example, if -2 (the default), the warning
would appear to come from whatever function called the function
that marked itself as deprecated (by calling this).
If script warnings are not enabled, this has no effect.
details about the deprecation and possible workarounds
the relative position on the stack frame to report as the source of the warning
Throws an error. If the argument is already an Error, it is thrown. If it is a Java exception (Throwable), a JS Error that wraps the exception is thrown. For any other object, an Error is thrown using the string value of the object as its error message.
an object to be converted into an Error and thrown
Prints a standard error message to the console to describe an exception. This function can be called to handle uncaught script errors in script code that outlives the execution of the script that defined it, such as an event listener or other Java interface implementation. For example:
function irritableFunction() {
if (--callsRemaining <= 0) {
throw new Error("Arrrggh!");
}
println("Please stop!");
}
let button = new swing.JButton("Press Me!");
button.addActionListener(function(event) {
try {
irritableFunction();
} catch(ex) {
Error.handleUncaught(ex);
}
});
Eons.window.addCustomComponent(button);
let callsRemaining = 3;
If script warnings are enabled in the user preferences,
prints a warning with the specified message text. If stackFrame
is
specified, it indicates the relative call site from which the warning
will appear to have come. For example, if -1 (the default), the warning
would appear to come from whatever function called warn
.
If script warnings are not enabled, this has no effect.
the text of the warning
the relative position on the stack frame to report as the source of the warning
This object contains helper functions related to throwing and catching errors (exceptions).