community[patch]: GCSDirectoryLoader bugfix (#20005)

- **Description:** Bug fix. Removed extra line in `GCSDirectoryLoader`
to allow catching Exceptions. Now also logs the file path if Exception
is raised for easier debugging.
- **Issue:** #20198 Bug since langchain-community==0.0.31
- **Dependencies:** No change
- **Twitter handle:** timothywong731

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
Timothy 2024-04-09 17:57:00 +01:00 committed by GitHub
parent ac42e96e4c
commit 0c848a25ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -65,10 +65,6 @@ class GCSDirectoryLoader(BaseLoader):
# intermediate directories on the fly
if blob.name.endswith("/"):
continue
loader = GCSFileLoader(
self.project_name, self.bucket, blob.name, loader_func=self._loader_func
)
docs.extend(loader.load())
# Use the try-except block here
try:
loader = GCSFileLoader(