ActiveStorage handles media uploads, the
Poppler gem takes care of preview generation to be used all across the application. In previous versions of Rails, a failure in creating a preview would capture a 0-byte IO stream and send that to
ActiveStorage. For instance, if a user uploaded a media file and the preview failed to generate, a 0-byte preview would still be stored and rendered, causing unexpected errors in the application.
A preview error will be raised if the storage fails to generate an identifier, or if the storage is not initialized. This change should help you identify issues with your serialization or deserialization strategy.
Rails 7 raises a
PreviewError when a previewer process exits with a non-0 status code.
This allows you to control the error response status code and gives you the opportunity to handle the error gracefully.
Check the commit to know more about it.