Skip to content

uncaughtException only catches the first uncaughtException. #5147

@NoahRoseLedesma

Description

@NoahRoseLedesma

Example:

process.on('uncaughtException', (err) => {
  console.log(`Caught exception: ${err}`);
  causeError();
});

function causeError(){
console.log(notDefined);
}
causeError();

Output:

Caught exception: ReferenceError: notDefined is not defined
C:\fail.js:7
console.log(notDefined);
            ^

ReferenceError: notDefined is not defined
    at causeError (C:\fail.js:7:13)
    at process.<anonymous> (C:\fail.js:3:3)
    at emitOne (events.js:77:13)
    at process.emit (events.js:169:7)
    at process._fatalException (node.js:223:26)
[Finished in 0.256s]

Tested on 64 bit Windows, and Ubuntu. Versions 4.2.3 and 0.10.41

Metadata

Metadata

Assignees

No one assigned

    Labels

    processIssues and PRs related to the process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions