mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 05:48:58 +08:00
fix: improve error handling for file retrieval in AwsS3Storage (#12002)
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
ef95b1268e
commit
c4091c4c66
@ -67,7 +67,9 @@ class AwsS3Storage(BaseStorage):
|
||||
yield from response["Body"].iter_chunks()
|
||||
except ClientError as ex:
|
||||
if ex.response["Error"]["Code"] == "NoSuchKey":
|
||||
raise FileNotFoundError("File not found")
|
||||
raise FileNotFoundError("file not found")
|
||||
elif "reached max retries" in str(ex):
|
||||
raise ValueError("please do not request the same file too frequently")
|
||||
else:
|
||||
raise
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user