pub enum SiteConfigError {
Read(PathBuf, Error),
Parse(PathBuf, String),
ZeroConcurrencyCeiling(PathBuf),
UnusableRefuseMarker {
path: PathBuf,
marker: String,
},
MarkerRootUnresolved {
path: PathBuf,
root: PathBuf,
cause: GitError,
},
MarkerUnreadable {
path: PathBuf,
marker: PathBuf,
cause: Error,
},
}Expand description
What went wrong loading the site policy file.
A separate enum from super::ConfigError, so the error’s type names
which of the two files is at fault. Folding these into ConfigError::Io and
ConfigError::Parse would make those variants reachable from two files with
two different grammars, and a reader could no longer tell which grammar was
violated from the variant alone.
Variants§
Read(PathBuf, Error)
Parse(PathBuf, String)
ZeroConcurrencyCeiling(PathBuf)
The clamp runs after super::validate, so a ceiling of zero would slip
past ConfigError::ZeroConcurrency and rebuild the hang it exists to
prevent: a semaphore with no permits, waited on forever with no message.
Rejected here so the clamp can never produce zero.
UnusableRefuseMarker
A marker that cannot name a file matches nothing, so the policy declaring it refuses nothing while reading as though it did.
MarkerRootUnresolved
Fails closed. A policy naming markers cannot be evaluated outside a
repository, and “cannot be evaluated” must not become “evaluates to
allowed”: that is the unenforced policy reported as compliance which
every message here refuses. cause rather than source because
main.rs prints {err:#}, which would otherwise print it twice.
MarkerUnreadable
Only NotFound means the marker is absent. Every other metadata error
means the policy could not be evaluated and must fail closed.
Trait Implementations§
Source§impl Debug for SiteConfigError
impl Debug for SiteConfigError
Source§impl Display for SiteConfigError
impl Display for SiteConfigError
Source§impl Error for SiteConfigError
impl Error for SiteConfigError
1.30.0 · 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()