std/uri/error
std/uri/src/error.trb
UriError: what a text is refused for as a URI, a URI reference, a URN, a file: path or a URI template. Every case
carries the display form of what was refused, so a password in it never reaches a message (docs/design/URI.md
section 11).
type UriError
type UriError with Show, Error
Why a text is not what it was read as.
case InvalidScheme
case InvalidScheme(text: String)
The text before the first : is not ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ).
case InvalidEscape
case InvalidEscape(text: String)
A % that is not followed by two hexadecimal digits, in text.
case InvalidHost
case InvalidHost(host: String, reason: String)
A host that is no IP literal, no IPv4 address and no registered name, and why; a zone identifier is one.
case NonAsciiHost
case NonAsciiHost(host: String)
A host whose percent escapes name bytes outside ASCII that are not UTF-8, so IDNA has no name to map (a host written outside ASCII is mapped to its A-labels, docs/design/URI.md slice 5).
case InvalidPort
case InvalidPort(text: String)
The text after the : of an authority is not a number from 0 to 65535.
case Relative
case Relative(text: String)
A relative reference where a Uri was asked for: a Uri has a scheme.
case NotText
case NotText(reason: String)
The bytes a percent escape named are not UTF-8, so there is no String for them.
case NotAFile
case NotAFile(uri: String, reason: String)
A Path was asked for from a URI that is not a file: URI of a path, and why.
case NotAUrn
case NotAUrn(uri: String, reason: String)
A Urn was asked for from a URI that is not one, and why.
case InvalidTemplate
case InvalidTemplate(template: String, reason: String)
A template that breaks RFC 6570, or a value the template cannot expand, and why.
case InvalidRoutes
case InvalidRoutes(reason: String)
Routes that do not fit the cases they stand for, or leave a case without a route: every problem, one per line.
fn show
fn show(): String
One line, naming the text that was refused.