Make more explicit error message for large thumbnails

This commit is contained in:
Tessa Walsh 2025-01-08 16:21:08 -05:00 committed by sua yoo
parent 0c81a2f89e
commit be9ff04ee8
No known key found for this signature in database
GPG Key ID: 5AD1B4C02D4F0567

View File

@ -762,7 +762,10 @@ class CollectionOps:
flush=True,
)
await self.storage_ops.delete_file_object(org, thumbnail_file)
raise HTTPException(status_code=400, detail="upload_failed")
raise HTTPException(
status_code=400,
detail="Upload failed: maxiumum thumbnail size (2 MB) exceeded",
)
if coll.thumbnail:
if not await self.storage_ops.delete_file_object(org, coll.thumbnail):