-
Hi there, this might be a bit of a silly question, but I'm trying to setup logic in Javet that makes it so:
I don't see any ways to capture that info from ES6 modules though. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No silly questions at all. Please checkout test case IJavetPromiseRejectCallback callback = (event, promise, value) -> { ... };
v8Runtime.setPromiseRejectCallback(callback); The reason that you get that error message is Javet has a built-in Note: const unhandledRejections = new Map();
process.on('unhandledRejection', (reason, promise) => {
unhandledRejections.set(promise, reason);
});
process.on('rejectionHandled', (promise) => {
unhandledRejections.delete(promise);
}); Please let me know if that covers your need, or new features may be proposed. |
Beta Was this translation helpful? Give feedback.
No silly questions at all.
Please checkout test case
com.caoccao.javet.values.reference.TestV8ValuePromise
. You may register a callback like the following.The reason that you get that error message is Javet has a built-in
com.caoccao.javet.utils.JavetPromiseRejectCallback
which does nothing but logs a warning message.Note:
setPromiseRejectCallback
is recommended to be used in V8 mode only because Node.js has its own way of handling that.