[FFL-1945] Remove redundant UNKNOWN_TYPE from ERROR_TYPE_MAP#5658
Conversation
Since normalize_error_type uses fetch with DEFAULT_ERROR_TYPE as the fallback, explicitly mapping UNKNOWN_TYPE is redundant. Any unmapped error codes (including UNKNOWN_TYPE) automatically default to 'general'.
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: a7f4331 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-05-05 15:44:56 Comparing candidate commit a7f4331 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 1 unstable metrics.
|
What does this PR do?
Removes the redundant
UNKNOWN_TYPEentry fromERROR_TYPE_MAPin the OpenFeature flag evaluation metrics.Motivation:
Follow-up to PR #5599 based on review feedback.
The
normalize_error_typemethod usesHash#fetchwithDEFAULT_ERROR_TYPEas the fallback, so explicitly mappingUNKNOWN_TYPE => DEFAULT_ERROR_TYPEis redundant. Any unmapped error codes (includingUNKNOWN_TYPE) automatically default to'general'.Change log entry
None.
Additional Notes:
Added behavioral tests to verify the defaulting mechanism works correctly for both
UNKNOWN_TYPEand arbitrary unmapped error codes.How to test the change?
bundle exec rake test:open_featureAll 98 tests pass on both
openfeature_latestandopenfeature_mingemfiles.