From f8a7749b46239e9b2f082178b6bbabe58905a64b Mon Sep 17 00:00:00 2001 From: Chris Weaver <25087905+Weves@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:47:36 -0700 Subject: [PATCH] Fix file too large error (#2799) * Fix file too large error * Add cannotDownloadFile --- backend/danswer/connectors/google_drive/connector.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/danswer/connectors/google_drive/connector.py b/backend/danswer/connectors/google_drive/connector.py index a50d632edb3e..9f8c6fbfda83 100644 --- a/backend/danswer/connectors/google_drive/connector.py +++ b/backend/danswer/connectors/google_drive/connector.py @@ -475,7 +475,15 @@ class GoogleDriveConnector(LoadConnector, PollConnector): if e.error_details else e.reason ) - if e.status_code == 403 and reason == "cannotExportFile": + + # these errors don't represent a failure in the connector, but simply files + # that can't / shouldn't be indexed + ERRORS_TO_CONTINUE_ON = [ + "cannotExportFile", + "exportSizeLimitExceeded", + "cannotDownloadFile", + ] + if e.status_code == 403 and reason in ERRORS_TO_CONTINUE_ON: logger.warning( f"Could not export file '{file['name']}' due to '{message}', skipping..." )