You are correct with Paperclip now using cocaine
for commands now. However the call to use cocaine
is internal so you can still use Paperclip.run
.
The arguments to run
are a little different:
def run(cmd, arguments = "", interpolation_values = {}, local_options = {})
so you might need to work on your cmd
a little to get it in the correct format. You can see examples in the source though where it makes calls file
and the various ImageMagick functions.
You should be able to trap your error with:
begin
Paperclip.run(cmd)
rescue ArgumentError, Cocaine::CommandLineError
raise Paperclip::Error.new("There was an error processing the tiles for #{@basename}") if @whiny
end
Note you also have to raise the Paperclip slightly differently now as PaperclipError
no longer exists.