Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 508b895

Browse files
authored
include featureKey in wrong-type log message (#321)
**Requirements** - [ ] I have added test coverage for new or changed functionality - [x] I have followed the repository's [pull request submission guidelines](../blob/master/CONTRIBUTING.md#submitting-pull-requests) - [ ] I have validated my changes against all supported platform versions **Describe the solution you've provided** Currently type errors do not include the name of the feature, which is a key ingredient to troubleshooting this error class. This adds the `featureKey` to the error message. **Describe alternatives you've considered** None
2 parents cbec479 + 0ce65a3 commit 508b895

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/main/java/com/launchdarkly/sdk/server/LDClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ private EvalResultAndFlag evalAndFlag(String featureKey, LDContext context, LDVa
537537
if (requireType != null &&
538538
!value.isNull() &&
539539
value.getType() != requireType) {
540-
evaluationLogger.error("Feature flag evaluation expected result as {}, but got {}", defaultValue.getType(), value.getType());
540+
evaluationLogger.error("Feature flag \"{}\"; evaluation expected result as {}, but got {}", featureKey, defaultValue.getType(), value.getType());
541541
recordEvaluationErrorEvent(featureFlag, context, defaultValue, EvaluationReason.ErrorKind.WRONG_TYPE, withDetail);
542542
return new EvalResultAndFlag(errorResult(EvaluationReason.ErrorKind.WRONG_TYPE, defaultValue), featureFlag);
543543
}

0 commit comments

Comments
 (0)