Commit c40d947e by Jon Yurek

Changed ENOENT to NotIdentifiedByImageMagick, which should work with whiny_thumbnails

parent 1b099cda
......@@ -65,6 +65,9 @@ module Paperclip
class PaperclipError < StandardError #:nodoc:
end
class NotIdentifiedByImageMagickError < PaperclipError #:nodoc:
end
module ClassMethods
# +has_attached_file+ gives the class it is called on an attribute that maps to a file. This
# is typically a file stored somewhere on the filesystem and has been uploaded by a user.
......
......@@ -189,10 +189,8 @@ module Paperclip
dimensions,
format,
@whiny_thumnails)
rescue Errno::ENOENT => e
@errors << "could not be processed because the file does not exist."
rescue PaperclipError => e
@errors << e.message
@errors << e.message if @whiny_thumbnails
end
end
end
......
......@@ -18,7 +18,7 @@ module Paperclip
def self.from_file file
file = file.path if file.respond_to? "path"
parse(`#{Paperclip.path_for_command('identify')} "#{file}"`) ||
raise(Errno::ENOENT, file)
raise NotIdentifiedByImageMagickError, "#{file} is not recognized by the 'identify' command."
end
# Parses a "WxH" formatted string, where W is the width and H is the height.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment