nerdgeschoss / shimmer

Shimmer is a collection of Rails extensions that bring advanced UI features into your app and make your life easier as a developer.
https://nerdgeschoss.de
MIT License
5 stars 1 forks source link

Don't blow up in FileController when invalid or deleted files are requested #89

Closed danieldiekmeier closed 9 months ago

danieldiekmeier commented 9 months ago

Hello!

Love the project, really helpful!

I noticed that when using the FileController, it would not handle missing assets. Our Sentry instance receives a lot of ActiveStorage::FileNotFoundErrors for assets that are removed from our S3 bucket.

It also blows up with ActiveRecord::RecordNotFound when requesting an invalid ID.

My suggestion is to catch these two cases and return a 404 instead.

Thank you for the consideration!