@@ -72,15 +72,7 @@ var Logger = exports.Logger = function (options) {
72
72
}
73
73
74
74
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 ) ;
84
76
}
85
77
} ;
86
78
@@ -377,8 +369,9 @@ Logger.prototype.close = function () {
377
369
} ;
378
370
379
371
//
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.
382
375
//
383
376
Logger . prototype . handleExceptions = function ( ) {
384
377
var args = Array . prototype . slice . call ( arguments ) ,
@@ -394,6 +387,7 @@ Logger.prototype.handleExceptions = function () {
394
387
}
395
388
} ) ;
396
389
390
+ this . exceptionHandlers = this . exceptionHandlers || { } ;
397
391
handlers . forEach ( function ( handler ) {
398
392
self . exceptionHandlers [ handler . name ] = handler ;
399
393
} ) ;
0 commit comments