DEV: split optimize image failure warnings in logs

This commit is contained in:
Sam 2018-08-15 13:27:24 +10:00
parent d4fd19d49a
commit cf788582cc

View File

@ -255,7 +255,15 @@ class OptimizedImage < ActiveRecord::Base
if opts[:raise_on_error]
raise e
else
Discourse.warn("Failed to optimize image", location: to, error_message: e.message)
error = +"Failed to optimize image:"
if e.message =~ /^convert:([^`]+)/
error << $1
else
error << " unknown reason"
end
Discourse.warn(error, location: to, error_message: e.message)
false
end
end