Skip to content

Commit 41d90c2

Browse files
authored
fix(api): throw error when notion block can not find (#11433)
1 parent 7ff42b1 commit 41d90c2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

api/libs/oauth_data_source.py

+2
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ def notion_block_parent_page_id(self, access_token: str, block_id: str):
253253
}
254254
response = requests.get(url=f"{self._NOTION_BLOCK_SEARCH}/{block_id}", headers=headers)
255255
response_json = response.json()
256+
if response.status_code != 200:
257+
raise ValueError(f"Error fetching block parent page ID: {response_json.message}")
256258
parent = response_json["parent"]
257259
parent_type = parent["type"]
258260
if parent_type == "block_id":

0 commit comments

Comments
 (0)