0
0
Fork 0

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

This commit is contained in:
David Roetzel 2024-06-27 16:41:03 +02:00 committed by GitHub
parent 42adb6eaee
commit ff08d99d4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 1 deletions

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