class UrlExtract::EncodingError
The error of a text that the extractor can not read as UTF-8: an invalid byte, a byte that is no character, or an encoding that the extractor can not convert.
It raises only with on_encoding_error: :raise. With the default, :warn, such a text gives no match and warns, and with :skip it gives no match and says nothing:
UrlExtract.scan("See https://example.com/x \xFF", on_encoding_error: :raise) # UrlExtract::EncodingError: Invalid text: can not be read as UTF-8 (encoding UTF-8, index 26) # [hint] Provide a valid UTF-8 string
It is an ArgumentError, as Ruby raises for an invalid byte. It is not Ruby’s ::EncodingError.