nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.44k stars 276 forks source link

enable exception for the embedder example #4403

Open bncdemo opened 1 month ago

bncdemo commented 1 month ago

Node.js Version

v20

NPM Version

23

Operating System

win10

Subsystem

process

Description

I am using the embedder example: https://nodejs.org/api/embedding.html

Can somebody point out how to catch exception? For example, when there is a syntax error in the js code (console..log('hi');) , the process just exit with error code 1, I see nothing else. Even if try-catch used, it is not called at all.

Minimal Reproduction

Run the https://nodejs.org/api/embedding.html example, and give an invalid js code like console..log('hi');

Output

The process exit when reach node::LoadEnvironment, with error code 1.

Before You Submit