@@ -72,15 +72,7 @@ var Logger = exports.Logger = function (options) {
7272 }
7373
7474 if ( options . exceptionHandlers ) {
75- handleExceptions = true ;
76- options . exceptionHandlers . forEach ( function ( handler ) {
77- self . _hnames . push ( handler . name ) ;
78- self . exceptionHandlers [ handler . name ] = handler ;
79- } ) ;
80- }
81-
82- if ( options . handleExceptions || handleExceptions ) {
83- this . handleExceptions ( ) ;
75+ this . handleExceptions ( options . exceptionHandlers ) ;
8476 }
8577} ;
8678
@@ -377,8 +369,9 @@ Logger.prototype.close = function () {
377369} ;
378370
379371//
380- // ### function handleExceptions ()
381- // Handles `uncaughtException` events for the current process
372+ // ### function handleExceptions ([tr0, tr1...] || tr0, tr1, ...)
373+ // Handles `uncaughtException` events for the current process by
374+ // ADDING any handlers passed in.
382375//
383376Logger . prototype . handleExceptions = function ( ) {
384377 var args = Array . prototype . slice . call ( arguments ) ,
@@ -394,6 +387,7 @@ Logger.prototype.handleExceptions = function () {
394387 }
395388 } ) ;
396389
390+ this . exceptionHandlers = this . exceptionHandlers || { } ;
397391 handlers . forEach ( function ( handler ) {
398392 self . exceptionHandlers [ handler . name ] = handler ;
399393 } ) ;
0 commit comments