Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't log exception if object doesn't exist #3724

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion rag/utils/minio_conn.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import time
from minio import Minio
from minio.error import S3Error
from io import BytesIO
from rag import settings
from rag.utils import singleton
Expand Down Expand Up @@ -84,8 +85,11 @@ def obj_exist(self, bucket, filename):
return True
else:
return False
except S3Error as e:
if e.code in ["NoSuchKey", "NoSuchBucket", "ResourceNotFound"]:
return False
except Exception:
logging.exception(f"Not found: {bucket}/{filename}")
logging.exception(f"obj_exist {bucket}/{filename} got exception")
return False

def get_presigned_url(self, bucket, fnm, expires):
Expand Down