#[non_exhaustive]pub enum ResolveError {
UnknownScheme {
uri: String,
scheme: String,
},
UriParseError {
uri: String,
source: UriParseError,
},
PathNotADirectory {
path: PathBuf,
},
RootEscape {
path: PathBuf,
},
Io {
path: PathBuf,
source: Error,
},
PathUriHasFragmentOrQuery {
uri: String,
},
Fetch {
uri: String,
source: FetchError,
},
CacheIo {
path: PathBuf,
source: Error,
},
}Expand description
Errors raised by resolve_namespace and resolve_namespace_with.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnknownScheme
URI didn’t match any registered scheme. scheme is the actual
missing scheme — for plain transport URIs that matches the
scheme of uri, but for forge-template URIs (github:,
gitlab:) it’s the expanded transport scheme (typically
https). That’s what the diagnostic needs to name so the user
understands which transport fetcher is missing from the
registry, not just that the original URI failed.
UriParseError
URI failed to parse syntactically (bad fragment, missing
scheme, …). Distinct from UnknownScheme: the URI is
malformed at the lex layer, not just pointed at a scheme we
don’t know.
PathNotADirectory
A path: URI pointed at a file that doesn’t exist or isn’t
a directory.
RootEscape
path: URI resolved to a path that escapes the workspace
root (relative paths like ../../etc/passwd). Same
invariant as the include-resolver — keeps a malicious
lex.toml from pointing at arbitrary system locations.
Io
path: resolution failed at the filesystem layer (permission
denied, broken symlink, …).
PathUriHasFragmentOrQuery
A path: URI carried a # fragment or ? query — those
are remote-only knobs (the resolver uses them on
github:/gitlab:/etc. for rev and subdir). Rejecting
instead of silently stripping surfaces typos like
path:dir#main (where the user almost certainly meant a
remote URI).
Fetch
A registered fetcher returned an error during the network fetch. Wraps the per-fetcher error type for context.
CacheIo
The cache directory couldn’t be created or written to. Distinct from a fetch IO error: this happens before we even call the fetcher.
Trait Implementations§
Source§impl Debug for ResolveError
impl Debug for ResolveError
Source§impl Display for ResolveError
impl Display for ResolveError
Source§impl Error for ResolveError
impl Error for ResolveError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()