pub enum DeclarativeError {
InvalidYaml(String),
InvalidDocument(String),
UnsupportedVersion(String),
RetiredVersion,
InvalidKind(String),
InvalidSchema(String),
InvalidBody(String),
InvalidTextSpec(String),
InvalidConfig(String),
CodeContractRef {
path: String,
target: String,
},
ContractRefRead {
target: String,
reason: String,
},
FileRead {
path: String,
reason: String,
},
}Expand description
A declarative document that could not be compiled into a contract / config.
Variants§
InvalidYaml(String)
the YAML text itself does not parse
InvalidDocument(String)
the document parses but is not a mapping with the required envelope
UnsupportedVersion(String)
an mcVersion outside the supported set — never best-effort parsed
RetiredVersion
mcVersion: 1 — retired; markdown-contract migrate rewrites a v1 document
InvalidKind(String)
a kind that is neither contract nor config
InvalidSchema(String)
a schema node outside the closed v2 vocabulary
InvalidBody(String)
a body-grammar node outside the v2 DSL (or a build-time grammar violation)
InvalidTextSpec(String)
a requires: / forbids: match spec outside the closed vocabulary (or a
duplicate / contradiction)
InvalidConfig(String)
a config document outside the v2 DSL
CodeContractRef
a config contract ref that is not a .yaml / .yml file, such as a .ts module
Fields
ContractRefRead
a referenced contract file could not be read
FileRead
a config or contract file passed to a *_file loader could not be read
Trait Implementations§
Source§impl Debug for DeclarativeError
impl Debug for DeclarativeError
Source§impl Display for DeclarativeError
impl Display for DeclarativeError
Source§impl Error for DeclarativeError
impl Error for DeclarativeError
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()