Catch encoding errors when creating link previews. (#30853)

This commit is contained in:
David Roetzel authored and GitHub committed 2024-06-27 14:41:03 +00:00
1 parent 42adb6eaee
commit ff08d99d4d
3 files changed
+15 -1

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@ class FetchLinkCardService < BaseService
end
attach_card if @card&.persisted?
rescue HTTP::Error, OpenSSL::SSL::SSLError, Addressable::URI::InvalidURIError, Mastodon::HostValidationError, Mastodon::LengthValidationError => e
rescue HTTP::Error, OpenSSL::SSL::SSLError, Addressable::URI::InvalidURIError, Mastodon::HostValidationError, Mastodon::LengthValidationError, Encoding::UndefinedConversionError => e
Rails.logger.debug { "Error fetching link #{@original_url}: #{e}" }
nil
end