FeedFailure
A failure of a feed document: the exchange and the policy were fine, the bytes were not a feed this module will read. Returned by a FeedParser and by FeedFetcher.fetch inside a Result.
Experimental (subclass). Subclassing needs @OptIn(ExperimentalForInheritanceWebToolsApi::class); creating a leaf, catching, matching and reading one are Stable Core. The leaves NotAFeed, Malformed, Refused and LimitExceeded are final with public constructors, so a parser of your own creates them. Match the leaves you care about and keep an else: new leaves may be added in a feature release.
Every message is constant text plus a reason's name; it never holds document content, a header value or a URL, and a leaf never carries a cause. Equality is identity.
Inheritors
Types
The document exceeds a FeedLimits bound that fails the parse.
The document is not well-formed XML, or the parser rejected it for a reason that is not one of the others.
The document is well-formed or empty or something else, but not a feed.
The document was refused before or while it was read: it carries a DOCTYPE, or its prolog cannot be read the way the parser reads it.