mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 05:29:17 -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]
|
if opts[:raise_on_error]
|
||||||
raise e
|
raise e
|
||||||
else
|
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
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user