From 20eada9710efc24e8a1ebfc46b5e614ca24a128e Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 14:53:53 +0000 Subject: [PATCH] fix: Map the WRONG_TYPE error kind to TYPE_MISMATCH Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com> --- ld_openfeature/impl/details_converter.py | 2 ++ tests/impl/test_details_converter.py | 1 + 2 files changed, 3 insertions(+) diff --git a/ld_openfeature/impl/details_converter.py b/ld_openfeature/impl/details_converter.py index bcf428a..f5eaa7a 100644 --- a/ld_openfeature/impl/details_converter.py +++ b/ld_openfeature/impl/details_converter.py @@ -100,6 +100,8 @@ def __error_kind_to_code(error_kind: Optional[str]) -> ErrorCode: return ErrorCode.PARSE_ERROR elif error_kind == 'USER_NOT_SPECIFIED': return ErrorCode.TARGETING_KEY_MISSING + elif error_kind == 'WRONG_TYPE': + return ErrorCode.TYPE_MISMATCH # NOTE: EXCEPTION_ERROR intentionally omitted diff --git a/tests/impl/test_details_converter.py b/tests/impl/test_details_converter.py index 19fffb1..3ee5b87 100644 --- a/tests/impl/test_details_converter.py +++ b/tests/impl/test_details_converter.py @@ -38,6 +38,7 @@ def test_ld_to_openfeature_kind_mappings(detail_kind: str, reason: Union[str, Re pytest.param('FLAG_NOT_FOUND', ErrorCode.FLAG_NOT_FOUND), pytest.param('MALFORMED_FLAG', ErrorCode.PARSE_ERROR), pytest.param('USER_NOT_SPECIFIED', ErrorCode.TARGETING_KEY_MISSING), + pytest.param('WRONG_TYPE', ErrorCode.TYPE_MISMATCH), pytest.param('EXCEPTION_ERROR', ErrorCode.GENERAL), ], )