clear metadata on upload failure

This commit is contained in:
Matthew Farrellee 2025-08-21 15:44:39 -04:00
parent 279736cfc4
commit 5358eaa251
2 changed files with 23 additions and 0 deletions

View file

@ -154,6 +154,8 @@ class S3FilesImpl(Files):
# TODO: enable server-side encryption
)
except ClientError as e:
await self.sql_store.delete("openai_files", where={"id": file_id})
raise RuntimeError(f"Failed to upload file to S3: {e}") from e
return OpenAIFileObject(