Skip to content

Commit b9296da

Browse files
authored
Return complete data object instead of message on RegoParse error handling
The response.data object contains some more information like error location and its details in it. Which is useful to identify the exact error and line number in Rego file
1 parent b1e6b5f commit b9296da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opa_client/opa.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ def __update_opa_policy_fromstring(self, new_policy: str,
413413
return True
414414

415415
raise RegoParseError(
416-
json.loads(response.data.decode()).get("code"),
417-
json.loads(response.data.decode()).get("message"),
416+
response.status,
417+
json.loads(response.data.decode())
418418
)
419419

420420
return False

0 commit comments

Comments
 (0)