Skip to content

Commit fd48f58

Browse files
fix(ofrep): use data.get for errorCode fallback to GENERAL
Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
1 parent 35fb9bd commit fd48f58

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • providers/openfeature-provider-ofrep/src/openfeature/contrib/provider/ofrep

providers/openfeature-provider-ofrep/src/openfeature/contrib/provider/ofrep/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _handle_error(self, exception: requests.RequestException) -> NoReturn:
185185
except JSONDecodeError:
186186
raise ParseError(str(exception)) from exception
187187

188-
error_code = ErrorCode(data["errorCode"])
188+
error_code = ErrorCode(data.get("errorCode", "GENERAL"))
189189
error_details = data["errorDetails"]
190190

191191
if error_code == ErrorCode.PARSE_ERROR:

0 commit comments

Comments
 (0)