mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
Putting all of the logic in a `finally` block is equivalent to a bare `except` block, which silently consumes all exceptions. Move only the most-necessary parts into the except; this lets `BadImageError` exceptions from `zerver/lib/upload.py` to escape, allowing better the generic "Image file upload failed" to be replaced with a more specific message. It also allows unexpected exceptions, as the previous commit resolved, to escape and 500. This lets them be detected and resolved, rather than give users a silently bad experience.
317 KiB
317 KiB