mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Supress logs when RetrieveTitle.crawl fails with Net::ReadTimeout errors (#16971)
This PR changes the rescue block to rescue only Net::TimeoutError exceptions and removes the log line to prevent clutter the logs with errors that are ignored. Other errors can bubble up because they're errors we probably want to know about
This commit is contained in:
@@ -9,10 +9,8 @@ module RetrieveTitle
|
||||
max_redirects: max_redirects,
|
||||
initial_https_redirect_ignore_limit: initial_https_redirect_ignore_limit
|
||||
)
|
||||
rescue Exception => ex
|
||||
raise if Rails.env.test?
|
||||
Rails.logger.error(ex)
|
||||
nil
|
||||
rescue Net::ReadTimeout
|
||||
# do nothing for Net::ReadTimeout errors
|
||||
end
|
||||
|
||||
def self.extract_title(html, encoding = nil)
|
||||
|
||||
Reference in New Issue
Block a user