Skip to content

How do I handle V8 Module Errors? #52

Answered by caoccao
Cormanz asked this question in Q&A
Discussion options

You must be logged in to vote

No silly questions at all.

Please checkout test case com.caoccao.javet.values.reference.TestV8ValuePromise. You may register a callback like the following.

IJavetPromiseRejectCallback callback = (event, promise, value) -> { ... };
v8Runtime.setPromiseRejectCallback(callback);

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.

const unhandledRejections = new Map();
process.on('unhandledRejection', (reason, promise) => {
  unhandledRejections.set(promise, re…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Cormanz
Comment options

Answer selected by caoccao
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants