Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Remove bad exception handling! #2476

Merged
merged 2 commits into from Oct 25, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tasks/paperclip.rake
Expand Up @@ -46,7 +46,7 @@ namespace :paperclip do
attachment = instance.send(name)
begin
attachment.reprocess!(*styles)
rescue Exception => e
rescue => e
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be even better to explicitly say rescue StandardError => e

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this appears to have the same problem as before, it's just now even broader. Agree in principle that rescuing from StandardError would be an improvement unless there's some system reason that we needed to use Exception here. Since it's not covered by a test I think we can assume this was just an oversight.

Paperclip::Task.log_error("exception while processing #{klass} ID #{instance.id}:")
Paperclip::Task.log_error(" " + e.message + "\n")
end
Expand Down