@@ -756,14 +756,14 @@ export default class EppoClient {
756756
757757 try {
758758 this . logBanditAction ( banditEvent ) ;
759- } catch ( err : any ) {
760- logger . error ( 'Error logging bandit event' , err ) ;
759+ } catch ( err ) {
760+ logger . error ( { err } , 'Error logging bandit event' ) ;
761761 }
762762
763763 evaluationDetails . banditAction = action ;
764764 }
765765 } catch ( err : any ) {
766- logger . error ( 'Error determining bandit action' , err ) ;
766+ logger . error ( { err } , 'Error determining bandit action' ) ;
767767 if ( ! this . isGracefulFailureMode ) {
768768 throw err ;
769769 }
@@ -772,7 +772,7 @@ export default class EppoClient {
772772 // Update the flag evaluation code to indicate that
773773 evaluationDetails . flagEvaluationCode = 'BANDIT_ERROR' ;
774774 }
775- evaluationDetails . flagEvaluationDescription = `Error evaluating bandit action: ${ err . message } ` ;
775+ evaluationDetails . flagEvaluationDescription = `Error evaluating bandit action: ${ err ? .message } ` ;
776776 }
777777 return { variation, action, evaluationDetails } ;
778778 }
@@ -877,7 +877,7 @@ export default class EppoClient {
877877 // Record in the assignment cache, if active, to deduplicate subsequent repeat assignments
878878 this . banditAssignmentCache ?. set ( banditAssignmentCacheProperties ) ;
879879 } catch ( err ) {
880- logger . warn ( 'Error encountered logging bandit action' , err ) ;
880+ logger . warn ( { err } , 'Error encountered logging bandit action' ) ;
881881 }
882882 }
883883
0 commit comments