#[non_exhaustive]pub enum Error {
Show 57 variants
InvalidName {
kind: NameKind,
value: String,
reason: &'static str,
},
InsecureToken {
url: RemoteUrl,
},
NotAccepted {
reason: &'static str,
},
StdoutOutputs {
target: Label,
outputs: usize,
},
CanonicalJson {
source: Error,
},
FloatRejected {
path: String,
},
UnreadableJson {
source: Error,
},
NonCanonicalJson {
offset: usize,
},
CorruptState {
file: PathBuf,
source: Box<Self>,
},
Evaluation {
provenance: Provenance,
failure: EvaluationFailure,
diagnostic: Diagnostic,
},
MissingBuildFile {
directory: Directory,
requested_by: Option<Provenance>,
},
InvalidDeclaration {
provenance: Provenance,
origin: Origin,
order: DeclarationOrder,
field: DeclarationField,
source: Box<Self>,
},
ActionConflict {
provenance: Provenance,
origin: Origin,
order: DeclarationOrder,
found: ActionFound,
},
Nondeterministic {
provenance: Provenance,
first_run: Option<Box<Declaration>>,
second_run: Option<Box<Declaration>>,
},
DiscoveryChanged {
label: Label,
provenance: Provenance,
},
DuplicateLabel {
label: Label,
sites: Vec<DeclarationSite>,
},
DuplicateSetting {
name: SettingName,
sites: Vec<Provenance>,
},
UnknownReference {
site: Box<DeclarationSite>,
field: DeclarationField,
reference: Label,
suggestion: Option<Label>,
},
WrongReferenceKind {
site: Box<DeclarationSite>,
field: DeclarationField,
reference: Label,
found: DeclaredKind,
declared_in: Provenance,
},
UnknownSetting {
site: Box<DeclarationSite>,
name: String,
suggestion: Option<SettingName>,
},
DependencyCycle {
path: Vec<DeclarationSite>,
},
TooManyTargets {
count: usize,
},
Refused {
want: Want,
site: Option<Box<DeclarationSite>>,
ceiling: Box<Ceiling>,
},
PluginRefused {
violation: Box<PluginViolation>,
},
NotApproved {
unapproved: Box<WantedSet>,
reason: DenialReason,
},
MissingTool {
site: Box<DeclarationSite>,
program: Program,
},
EnvNotMarked {
site: Box<DeclarationSite>,
},
EnvBadMark {
site: Box<DeclarationSite>,
name: EnvName,
found: String,
},
MachinePathInCommand {
site: Box<DeclarationSite>,
folder: String,
},
MachinePathInVariable {
site: Box<DeclarationSite>,
name: EnvName,
folder: String,
},
MachinePathInSetting {
site: Box<DeclarationSite>,
name: SettingName,
folder: String,
},
MachinePathInDiscovery {
site: Box<DeclarationSite>,
folder: String,
},
UnkeyedNotRead {
file: String,
table: String,
name: EnvName,
},
PinnedEnv {
name: EnvName,
value: EnvValue,
site: Box<DeclarationSite>,
},
MissingInput {
site: Box<DeclarationSite>,
path: SourcePath,
},
InputNotAFile {
site: Box<DeclarationSite>,
path: SourcePath,
found: InputKind,
},
UnknownOverride {
name: SettingName,
},
UnknownTarget {
label: Label,
suggestion: Option<Label>,
},
NotATest {
asked: Label,
declared_with: TargetRole,
site: Box<DeclarationSite>,
},
InvalidQuery {
expression: String,
},
NoRun {
label: Label,
suggestion: Option<Label>,
damaged: Vec<NonZeroUsize>,
},
MissingOutput {
label: Label,
},
ForeignPlan,
UploadUnsandboxed {
which: UnsandboxedRemote,
},
RemoteToken {
from: TokenSource,
},
RemoteSwitch {
name: RemoteVariable,
value: String,
},
RemoteFlags {
conflict: RemoteFlagConflict,
},
OutputConflict {
path: OutputPath,
first: Box<DeclarationSite>,
second: Box<DeclarationSite>,
},
NoProgram {
site: Box<DeclarationSite>,
},
DispatcherFault {
targets: Vec<Label>,
},
LostBuildFiles {
directories: Vec<Directory>,
},
Adapter {
port: PortName,
diagnostic: Diagnostic,
},
InvalidTree {
fault: TreeFault,
},
PluginTree {
plugin: PluginName,
path: PathBuf,
},
PluginNotFetched {
plugin: PluginName,
reason: String,
},
PluginChanged {
plugin: PluginName,
reason: String,
},
PluginFetch {
plugin: PluginName,
diagnostic: Diagnostic,
},
}Expand description
Every way a call into this crate can fail.
Non-exhaustive: adding a variant is not a breaking change for downstream crates.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidName
A domain name did not satisfy its grammar.
Fields
InsecureToken
A remote cache is given a token but named by a grpc:// URL, which sends it unencrypted.
NotAccepted
A declaration holds a value its kind of target does not take.
StdoutOutputs
A target whose output is its stdout does not declare exactly one output.
CanonicalJson
A value could not be serialized as JSON at all.
FloatRejected
A floating-point number reached the canonical serializer.
UnreadableJson
Bytes could not be read as a value: they are not JSON, or the JSON does not describe a valid value of the type asked for.
NonCanonicalJson
Bytes describe a valid value, but are not the bytes the canonical serializer writes for it.
CorruptState
A file an adapter keeps a workspace’s state in does not hold what the adapter writes there.
Distinct from Error::Adapter, which is a file that could not be read at all: this
one was read, and its content is refused. source is the reading failure,
Error::UnreadableJson or Error::NonCanonicalJson.
Fields
Evaluation
An adapter could not evaluate a build file.
Fields
provenance: ProvenanceThe build file.
failure: EvaluationFailureWhat kind of failure it was.
diagnostic: DiagnosticThe adapter’s message, for display only.
MissingBuildFile
A directory that had to be evaluated holds no build file.
Fields
requested_by: Option<Provenance>The build file whose subdir call requested it; None for the workspace root.
InvalidDeclaration
A value in a declaration did not satisfy its grammar.
Fields
provenance: ProvenanceThe build file.
order: DeclarationOrderThe call’s position in the file.
field: DeclarationFieldThe field holding the value.
ActionConflict
A target named both or neither of rule and run.
Fields
provenance: ProvenanceThe build file.
order: DeclarationOrderThe call’s position in the file.
found: ActionFoundWhat was found instead of exactly one.
Nondeterministic
Two evaluations of the same workspace declared different things.
Fields
provenance: ProvenanceThe build file to fix: the one whose declaration the other evaluation lacks.
first_run: Option<Box<Declaration>>The first evaluation’s declaration at the first difference; None past its end.
second_run: Option<Box<Declaration>>The second evaluation’s declaration at the first difference; None past its end.
DiscoveryChanged
The build files, evaluated with the results of the discovery targets, declared different discovery targets than they did without them.
Fields
label: LabelThe first discovery target, in declaration order, that one evaluation declared and the other did not or declared differently.
provenance: ProvenanceThe build file that declares it.
DuplicateLabel
A label was declared more than once, as any mix of target, rule and alias.
Fields
sites: Vec<DeclarationSite>Every declaration of it, with its build file and whose code made it, in the declarations’ own order.
DuplicateSetting
A build setting was declared more than once.
Fields
name: SettingNameThe setting.
sites: Vec<Provenance>The build file of every declaration of it, in the declarations’ own order.
UnknownReference
A reference names a label nothing declares.
Fields
site: Box<DeclarationSite>The declaration holding the reference, and its build file.
field: DeclarationFieldWhich field holds it: a dependency, a rule reference or an alias’s target.
WrongReferenceKind
A reference names a declaration of a kind its field cannot name.
Fields
site: Box<DeclarationSite>The declaration holding the reference, and its build file.
field: DeclarationFieldWhich field holds it: a dependency, a rule reference or an alias’s target.
found: DeclaredKindWhat that label was declared as.
declared_in: ProvenanceThe build file that declared it.
UnknownSetting
A command references a build setting nothing declares.
Fields
site: Box<DeclarationSite>The target or rule holding the reference in its command, or the rule holding it in its description, and its build file.
suggestion: Option<SettingName>The nearest declared setting, if one is near enough.
DependencyCycle
The targets’ dependencies form a cycle.
Fields
path: Vec<DeclarationSite>The targets on the cycle, lowest label first; each depends on the next, and the last on the first.
TooManyTargets
The workspace declares more targets than the graph has ids for.
Refused
A build wants something its workspace’s ceiling does not allow.
Fields
site: Option<Box<DeclarationSite>>The lowest-labelled target wanting it, and its build file; None for a directory
the build writes into, which the workspace names and no target declares.
PluginRefused
A plugin’s target wants something its plugin does not allow.
Fields
violation: Box<PluginViolation>The want, the target that made it, and the plugin that does not allow it.
NotApproved
The approver did not approve what a build wants.
Fields
reason: DenialReasonWhy, in words for the user.
MissingTool
A command names a program that cannot be found.
Fields
site: Box<DeclarationSite>The lowest-labelled target whose command names the program, and its build file.
EnvNotMarked
A target’s env is a list, or holds a list entry, where each variable needs a mark.
Fields
site: Box<DeclarationSite>The target, and its build file.
EnvBadMark
A target marks a variable with something other than "key" or "unkeyed".
Fields
site: Box<DeclarationSite>The target, and its build file.
MachinePathInCommand
A command holds one of this machine’s folders, which would give its target another key on every machine.
Fields
site: Box<DeclarationSite>The target or rule whose command holds it, and its build file.
MachinePathInVariable
The value of a variable a target marks key holds one of this machine’s folders.
Fields
site: Box<DeclarationSite>The first target, in graph order, that marks the variable key, and its build file.
MachinePathInSetting
The value of a setting a target’s command names holds one of this machine’s folders.
Fields
site: Box<DeclarationSite>The first target, in graph order, whose command names the setting, and its build file.
name: SettingNameThe setting.
MachinePathInDiscovery
The output of a discovery target holds one of this machine’s folders.
Fields
site: Box<DeclarationSite>The discovery target, and its build file.
UnkeyedNotRead
An env.unkeyed list names a variable the same table’s env.read does not.
Fields
PinnedEnv
A target declares an environment variable the workspace’s execution strategy sets itself.
Fields
site: Box<DeclarationSite>The lowest-labelled target declaring the variable, and its build file.
MissingInput
A target reads a workspace file that does not exist.
Fields
site: Box<DeclarationSite>The lowest-labelled target declaring the input, and its build file.
path: SourcePathThe file.
InputNotAFile
A target reads a workspace path that holds something other than a regular file.
Fields
site: Box<DeclarationSite>The lowest-labelled target declaring the input, and its build file.
path: SourcePathThe path.
UnknownOverride
A setting was given a value for this run, but nothing declares it.
Fields
name: SettingNameThe setting that was named.
UnknownTarget
A run or a query was asked for a target, and no target or alias has that label.
Fields
NotATest
A test run was asked for a target that is not a test.
Fields
declared_with: TargetRoleThe role the target it names was declared with, which says which function declared it.
site: Box<DeclarationSite>The target it names, which is the same label unless an alias was followed, and its build file.
InvalidQuery
A query was written in neither of the two forms a query takes.
NoRun
A log was asked for a target with no run in it.
Fields
damaged: Vec<NonZeroUsize>Every damaged line of the log, by number, in order: one of them may have been this target’s run.
MissingOutput
What a target printed in its last logged run is no longer in the content store.
ForeignPlan
A plan was handed over with a graph it was not made from.
UploadUnsandboxed
Uploading to the remote cache, or having the remote run actions, was asked for, and actions run bare.
A bare action can read files it did not declare, so a result it produced is not known to depend only on its declared inputs, and no one else could trust it.
Fields
which: UnsandboxedRemoteWhat was asked for.
RemoteToken
The remote cache’s token is named, and cannot be used: the variable is unset or not text, the file is unreadable, or the token holds a character a header cannot carry.
The error names where the token should have come from and never holds the token itself.
Fields
from: TokenSourceThe variable or file the token was to come from.
RemoteSwitch
A remote cache switch variable holds something other than 1 or 0.
RemoteFlags
The remote cache flags of a run contradict each other or the workspace.
Fields
conflict: RemoteFlagConflictWhat is wrong with the combination.
OutputConflict
Two outputs would be written to one place: the same path, or a path that another output needs as a directory.
Fields
path: OutputPathThe shorter of the two paths: the one both outputs need.
first: Box<DeclarationSite>The lower-labelled of the two targets, and its build file.
second: Box<DeclarationSite>The other target, and its build file; the same target when it declares both outputs.
NoProgram
A command names no program once its placeholders are expanded: it expanded to no
argument, or its first argument is empty or still holds a $.
Fields
site: Box<DeclarationSite>The target whose command it is, and its build file.
DispatcherFault
The dispatcher returned success and left targets without an outcome: it lost a task, or the result of one, and with it everything that waited on that target.
Not an Error::Adapter: that carries an adapter’s own failure as text for display,
while this names the targets left without an outcome, as data.
LostBuildFiles
The dispatcher returned success and left build files unevaluated: it lost a task, or the result of one.
The load’s counterpart of Error::DispatcherFault, naming directories, not targets.
Fields
Adapter
An adapter could not do what a port asked of it.
Fields
diagnostic: DiagnosticThe adapter’s message, for display only.
InvalidTree
A list of files is not a directory tree.
PluginTree
A plugin’s directory holds something other than regular files with Unicode names.
PluginNotFetched
A plugin buildl.toml names is not there to use: it is a directory that does not
exist, a git plugin that buildl.lock does not pin as buildl.toml names it or whose
store is missing, or a git revision that holds no file, or no folder at the plugin’s dir.
PluginChanged
A plugin’s files are not the ones buildl.lock pinned: the store was changed after the
plugin was fetched.
PluginFetch
git could not fetch a plugin: it is not installed, or it refused the repository, the
revision or the checkout.
Fields
plugin: PluginNameThe plugin.
diagnostic: DiagnosticWhat git printed, or why it could not be run, for display only.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()