public class UnhandledRejectionTracker
extends java.lang.Object
Different frameworks will choose different ways to handle unhandled rejections. As a result, Rhino does nothing by default.
However, if "trackUnhandledPromiseRejections" is called on the Context object, then Rhino will track them in this object. It is the responsibility of the product embedding Rhino to periodically check for unhandled rejections in this class and either remove them or terminate the script and allow the context and its tracker to be garbage- collected.
Note that if "trackUnhandledPromiseRejections" is set, and rejections are not handled, then Promise objects will accumulate in this object and cause a memory leak.
Constructor and Description |
---|
UnhandledRejectionTracker() |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Object> |
enumerate()
Return a collection of all of the results of any unhandled rejected promises.
|
void |
process(java.util.function.Consumer<java.lang.Object> handler)
Iterate through all the rejected promises that have not yet been handled.
|
public void process(java.util.function.Consumer<java.lang.Object> handler)
public java.util.List<java.lang.Object> enumerate()