mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-10-10 13:15:18 +02:00
Fix Notion recursive search for non-shared database
This commit is contained in:
@@ -129,6 +129,15 @@ class NotionConnector(LoadConnector, PollConnector):
|
|||||||
try:
|
try:
|
||||||
res.raise_for_status()
|
res.raise_for_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
if res.json().get("code") == "object_not_found":
|
||||||
|
# this happens when a database is not shared with the integration
|
||||||
|
# in this case, we should just ignore the database
|
||||||
|
logger.error(
|
||||||
|
f"Unable to access database with ID '{database_id}'. "
|
||||||
|
f"This is likely due to the database not being shared "
|
||||||
|
f"with the Danswer integration. Exact exception:\n{e}"
|
||||||
|
)
|
||||||
|
return {"results": [], "next_cursor": None}
|
||||||
logger.exception(f"Error fetching database - {res.json()}")
|
logger.exception(f"Error fetching database - {res.json()}")
|
||||||
raise e
|
raise e
|
||||||
return res.json()
|
return res.json()
|
||||||
|
Reference in New Issue
Block a user