Home / CSE / Javascript - CS :: Discussion

Discussion :: Javascript - CS

  1. When do uncaught exceptions generate events?

  2. A.

     When handlers are registered

    B.

     When handlers are deregistered

    C.

     When handler functions are called

    D.

     When handlers do not have a matching catch clause

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Uncaught exceptions generate events, if any handlers are registered. Otherwise, the exception just makes Node print an error and exit.

    process.on("uncaughtException", function(e) { console.log(Exception, e); });


Be The First To Comment