mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-04 11:24:00 +08:00
Don't log exception if object doesn't exist (#3724)
### What problem does this PR solve? Don't log exception if object doesn't exist. Close #1483 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
966bcda6b9
commit
80af3cc2d4
@ -1,6 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
from minio import Minio
|
from minio import Minio
|
||||||
|
from minio.error import S3Error
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from rag import settings
|
from rag import settings
|
||||||
from rag.utils import singleton
|
from rag.utils import singleton
|
||||||
@ -84,8 +85,11 @@ class RAGFlowMinio(object):
|
|||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
except S3Error as e:
|
||||||
|
if e.code in ["NoSuchKey", "NoSuchBucket", "ResourceNotFound"]:
|
||||||
|
return False
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception(f"Not found: {bucket}/{filename}")
|
logging.exception(f"obj_exist {bucket}/{filename} got exception")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_presigned_url(self, bucket, fnm, expires):
|
def get_presigned_url(self, bucket, fnm, expires):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user