fix asset

This commit is contained in:
itqop 2025-12-30 18:03:49 +03:00
parent 0a41aad937
commit 67b4400d99
1 changed files with 2 additions and 0 deletions

View File

@ -302,6 +302,8 @@ class AssetService:
except ClientError as e:
error_code = e.response.get("Error", {}).get("Code", "")
if error_code == "NoSuchKey":
# File not found in S3 - delete asset from database
await self.asset_repo.delete(asset)
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail="Media file not found in storage",