Skip to content

Commit

Permalink
feat: When rest api raise http error, print the resp content (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
zongsizhang authored Sep 12, 2024
1 parent 20948b4 commit ee99a00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion airflow_providers_wherobots/hooks/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def _api_call(
resp = self.session.request(
url=url, method=method, json=payload, auth=auth, params=params
)
resp.raise_for_status()
try:
resp.raise_for_status()
except requests.HTTPError as e:
raise RuntimeError(f"HTTP error: {e} with response: {resp.text}") from e
return resp

def get_run(self, run_id: str) -> Run:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "airflow-providers-wherobots"
version = "0.1.12"
version = "0.1.13"
description = "Airflow extension for communicating with Wherobots Cloud"
authors = ["zongsi.zhang <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit ee99a00

Please sign in to comment.