Skip to content

Commit

Permalink
Merge pull request #19446 from itisAliRH/s3fs-list-error-improvment
Browse files Browse the repository at this point in the history
Handles S3 listing errors
  • Loading branch information
jmchilton authored Jan 28, 2025
2 parents 3b9f75c + 6718c01 commit a8b1646
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/galaxy/files/sources/s3fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Unpack,
)

from galaxy import exceptions
from galaxy.files import OptionalUserContext
from . import (
AnyRemoteEntry,
Expand Down Expand Up @@ -93,7 +94,10 @@ def _list(
return res, len(res)
else:
bucket_path = self._bucket_path(_bucket_name, path)
res = fs.ls(bucket_path, detail=True)
try:
res = fs.ls(bucket_path, detail=True)
except Exception as e:
raise exceptions.MessageException(f"Error listing {bucket_path}: {e}")
to_dict = functools.partial(self._resource_info_to_dict, path)
return list(map(to_dict, res)), len(res)

Expand Down

0 comments on commit a8b1646

Please sign in to comment.