Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Fail more gracefully from ActiveStorage missing file exceptions #33666
This PR translates service-specific missing object exceptions into one generic
Last thing: can you please squash your commits? I think two are appropriate: one for rescuing
I also think these changes merit separate changelog entries, since they're independent:
`ActiveStorage::Blob#download` and `ActiveStorage::Blob#open` raise `ActiveStorage::FileNotFoundError` when the corresponding file is missing from the storage service. Services translate service-specific missing object exceptions (e.g. `Google::Cloud::NotFoundError` for the GCS service and `Errno::ENOENT` for the disk service) into `ActiveStorage::FileNotFoundError`.
`ActiveStorage::DiskController#show` generates a 404 Not Found response when the requested file is missing from the disk service. It previously raised `Errno::ENOENT`.
I’m not immediately sure what we can do about that. I’m going to think about it and merge this in the meantime.