Fix undefined `ResponseError`

`ResponseError` is currently undefined. It manifests when an exception
is raised in the `try` block.

`ResponseError` was renamed[1] to `S3Error` in minio 7.0.0.

[1]: b81883a98e
This commit is contained in:
Naglis Jonaitis 2024-02-06 09:30:28 +02:00 committed by Simon Ser
parent d3ff388b65
commit 2a40a3f233
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import shutil
import subprocess
from gitsrht.types import Artifact, Repository, Redirect
from minio import Minio
from minio.error import S3Error
from srht.config import cfg
from srht.database import db
from werkzeug.utils import secure_filename
@ -35,7 +36,7 @@ def delete_artifact(artifact):
repo.owner.canonical_name, repo.name)
try:
minio.remove_object(s3_bucket, f"{prefix}/{artifact.filename}")
except ResponseError as err:
except S3Error as err:
print(err)
db.session.delete(artifact)