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

Commit

Permalink
Remove bad exception handling!
Browse files Browse the repository at this point in the history
Exception is the root of Ruby's exception hierarchy, so when you rescue Exception you rescue from everything, including subclasses such as SyntaxError, LoadError, and Interrupt etc which is a bad idea.

Fix: rescue from StandardError.
  • Loading branch information
gaurish authored and geoffharcourt committed Oct 25, 2017
1 parent 9b48053 commit 8253c89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tasks/paperclip.rake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace :paperclip do
attachment = instance.send(name)
begin
attachment.reprocess!(*styles)
rescue Exception => e
rescue => e
Paperclip::Task.log_error("exception while processing #{klass} ID #{instance.id}:")
Paperclip::Task.log_error(" " + e.message + "\n")
end
Expand Down

0 comments on commit 8253c89

Please sign in to comment.