Skip to content

Commit

Permalink
API: Oops, bufix so bad opa status codes will raise an error
Browse files Browse the repository at this point in the history
  • Loading branch information
roekatz committed Oct 31, 2023
1 parent 16272e8 commit e7726f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion horizon/enforcer/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ async def post_to_opa(request: Request, path: str, data: dict):
data=json.dumps(data) if data is not None else None,
headers=headers,
timeout=sidecar_config.OPA_CLIENT_QUERY_TIMEOUT,
raise_for_status=True,
) as opa_response:
return await proxy_response(opa_response)
except asyncio.exceptions.TimeoutError:
Expand All @@ -217,7 +218,6 @@ async def post_to_opa(request: Request, path: str, data: dict):
detail="OPA request timed out (url: {url}, timeout: {timeout}s)".format(
url=url,
timeout=sidecar_config.OPA_CLIENT_QUERY_TIMEOUT,
raise_for_status=True,
),
)
except aiohttp.ClientResponseError as e:
Expand Down

0 comments on commit e7726f8

Please sign in to comment.