mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -06:00
DEV: split optimize image failure warnings in logs
This commit is contained in:
parent
d4fd19d49a
commit
cf788582cc
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user