mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
DEV: split optimize image failure warnings in logs
This commit is contained in:
parent
d4fd19d49a
commit
cf788582cc
1 changed files with 9 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue