File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -360,12 +360,13 @@ exit with 0.
360
360
361
361
``` mjs
362
362
import process from ' node:process' ;
363
+ import fs from ' node:fs' ;
363
364
364
365
process .on (' uncaughtException' , (err , origin ) => {
365
366
fs .writeSync (
366
367
process .stderr .fd ,
367
368
` Caught exception: ${ err} \n ` +
368
- ` Exception origin: ${ origin} ` ,
369
+ ` Exception origin: ${ origin} \n ` ,
369
370
);
370
371
});
371
372
@@ -380,12 +381,13 @@ console.log('This will not run.');
380
381
381
382
``` cjs
382
383
const process = require (' node:process' );
384
+ const fs = require (' node:fs' );
383
385
384
386
process .on (' uncaughtException' , (err , origin ) => {
385
387
fs .writeSync (
386
388
process .stderr .fd ,
387
389
` Caught exception: ${ err} \n ` +
388
- ` Exception origin: ${ origin} ` ,
390
+ ` Exception origin: ${ origin} \n ` ,
389
391
);
390
392
});
391
393
You can’t perform that action at this time.
0 commit comments