File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -68,23 +68,20 @@ export default class Notifier {
6868 * backend in case of success.
6969 */
7070 log ( item , callback ) {
71- let cb = callback ;
72- if ( ! cb || ! isFunction ( cb ) ) {
73- cb = function ( ) { } ;
74- }
71+ callback = isFunction ( callback ) ? callback : ( ) => { } ;
7572
7673 if ( ! this . options . enabled ) {
77- return cb ( new Error ( 'Rollbar is not enabled' ) ) ;
74+ return callback ( new Error ( 'Rollbar is not enabled' ) , null ) ;
7875 }
7976
8077 this . queue . addPendingItem ( item ) ;
8178 const originalError = item . err ;
8279 this . _applyTransforms ( item , ( err , i ) => {
8380 if ( err ) {
8481 this . queue . removePendingItem ( item ) ;
85- return cb ( err , null ) ;
82+ return callback ( err , null ) ;
8683 }
87- this . queue . addItem ( i , cb , originalError , item ) ;
84+ this . queue . addItem ( i , callback , originalError , item ) ;
8885 } ) ;
8986 }
9087
You can’t perform that action at this time.
0 commit comments