Skip to content

Commit

Permalink
fix(api): throw error when notion block can not find (#11433)
Browse files Browse the repository at this point in the history
  • Loading branch information
TreyDong authored Dec 9, 2024
1 parent 7ff42b1 commit 41d90c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/libs/oauth_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ def notion_block_parent_page_id(self, access_token: str, block_id: str):
}
response = requests.get(url=f"{self._NOTION_BLOCK_SEARCH}/{block_id}", headers=headers)
response_json = response.json()
if response.status_code != 200:
raise ValueError(f"Error fetching block parent page ID: {response_json.message}")
parent = response_json["parent"]
parent_type = parent["type"]
if parent_type == "block_id":
Expand Down

0 comments on commit 41d90c2

Please sign in to comment.