mirror of
https://github.com/penpot/penpot.git
synced 2026-07-23 06:28:14 +00:00
When ImageMagick fails to process an uploaded image (e.g., corrupted PNG with invalid IHDR data), the backend was raising :type :internal with :code :imagemagick-error, which mapped to HTTP 500. The frontend treated this as a server error and displayed the full error page. Changed exec-magick! to raise :type :validation with :code :invalid-image instead. This flows through the existing :invalid-image handler in errors.clj which returns HTTP 400. The frontend's handle-media-error and process-error now catch this code and show a notification banner. AI-assisted-by: qwen3.7-plus