Skip to content

Commit

Permalink
Make more explicit error message for large thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Jan 8, 2025
1 parent b103e79 commit d998eba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/btrixcloud/colls.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,10 @@ async def stream_iter():
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):
Expand Down

0 comments on commit d998eba

Please sign in to comment.