@@ -756,14 +756,14 @@ export default class EppoClient {
756
756
757
757
try {
758
758
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' ) ;
761
761
}
762
762
763
763
evaluationDetails . banditAction = action ;
764
764
}
765
765
} catch ( err : any ) {
766
- logger . error ( 'Error determining bandit action' , err ) ;
766
+ logger . error ( { err } , 'Error determining bandit action' ) ;
767
767
if ( ! this . isGracefulFailureMode ) {
768
768
throw err ;
769
769
}
@@ -772,7 +772,7 @@ export default class EppoClient {
772
772
// Update the flag evaluation code to indicate that
773
773
evaluationDetails . flagEvaluationCode = 'BANDIT_ERROR' ;
774
774
}
775
- evaluationDetails . flagEvaluationDescription = `Error evaluating bandit action: ${ err . message } ` ;
775
+ evaluationDetails . flagEvaluationDescription = `Error evaluating bandit action: ${ err ? .message } ` ;
776
776
}
777
777
return { variation, action, evaluationDetails } ;
778
778
}
@@ -877,7 +877,7 @@ export default class EppoClient {
877
877
// Record in the assignment cache, if active, to deduplicate subsequent repeat assignments
878
878
this . banditAssignmentCache ?. set ( banditAssignmentCacheProperties ) ;
879
879
} catch ( err ) {
880
- logger . warn ( 'Error encountered logging bandit action' , err ) ;
880
+ logger . warn ( { err } , 'Error encountered logging bandit action' ) ;
881
881
}
882
882
}
883
883
0 commit comments