enum

Krikri::PluginHelpers::URLPreflight::Kind

Inherits Enum < Comparable < Value < Object

How the calling module has to shape its own result around the message - the three handlers above do NOT produce the same keys.

Constants

MissingLibrary = 0

MissingModuleError: {changed: false, msg} and nothing else.

ConnectionFailure = 1

fetch_url's info dict for an OSError: the caller formats its own module-level message around "Connection failure: ..." and adds url/dest/elapsed (get_url) or url/status/elapsed/redirected/ content (uri) - see the call sites.

UnknownUrlType = 2

ValueError from urllib: {msg, url, status: -1}. Also reused for the http.client ASCII-encode failure on a non-ASCII request target, whose fetch_url result carries the same keys.

UnknownUrlScheme = 3

URLError from urllib's UnknownHandler: a URL that HAS a type no default handler serves (gopher://..., "127.0.0.1:80/x") is not a Request-construction failure - the request object builds fine and dies at open() - so it arrives as info['msg'] with status -1, the same dict the OSError half above produces.

Instance methods

connection_failure?

Returns true if this enum value equals ConnectionFailure

Source
missing_library?

Returns true if this enum value equals MissingLibrary

Source
unknown_url_scheme?

Returns true if this enum value equals UnknownUrlScheme

Source
unknown_url_type?

Returns true if this enum value equals UnknownUrlType

Source