pub enum Error {
Show 19 variants
NonUtf8Path {
path: PathBuf,
},
PathDoesNotExist {
path: Utf8PathBuf,
},
NotLeanFile {
path: Utf8PathBuf,
},
InvalidLineSpec {
spec: String,
},
Io(Error),
Json(Error),
ConfigRead {
path: Utf8PathBuf,
source: Error,
},
ConfigParse {
path: Utf8PathBuf,
source: Error,
},
Timeout {
file: Utf8PathBuf,
timeout_seconds: u64,
},
OutsideWorkspace {
path: Utf8PathBuf,
},
ZeroLineSpan {
file: Utf8PathBuf,
},
InvertedSpan {
file: Utf8PathBuf,
start_line: u32,
end_line: u32,
},
SpanOutOfBounds {
file: Utf8PathBuf,
start_line: u32,
end_line: u32,
line_count: usize,
},
MultiFileEditNotAllowed {
files: usize,
},
DisallowedReplacement {
file: Utf8PathBuf,
detail: String,
},
RunnerSpawn {
runner: Utf8PathBuf,
source: Error,
},
RunnerProtocol {
detail: String,
},
WorkspaceCopy {
path: Utf8PathBuf,
source: Error,
},
Todo {
feature: &'static str,
},
}Expand description
Errors produced by tracing, parsing, discovery, and writing.
Variants§
NonUtf8Path
A filesystem path could not be represented as UTF-8.
PathDoesNotExist
A requested path does not exist.
Fields
path: Utf8PathBufMissing path.
NotLeanFile
A requested path is not a Lean source file.
Fields
path: Utf8PathBufInvalid file path.
InvalidLineSpec
A FILE.lean:LINE target could not be parsed.
Io(Error)
IO failure.
Json(Error)
JSON serialization/deserialization failure.
ConfigRead
A config file could not be read from disk.
ConfigParse
A config file could not be parsed as TOML.
Timeout
External Lean/Lake process timed out.
OutsideWorkspace
An edit path is absolute or uses .., so it could escape the workspace.
Fields
path: Utf8PathBufThe offending relative path as given.
ZeroLineSpan
A span carried a zero line number; lines are one-based.
Fields
file: Utf8PathBufFile the span pointed at.
InvertedSpan
A span’s start line is greater than its end line.
Fields
file: Utf8PathBufFile the span pointed at.
SpanOutOfBounds
A span falls outside the target file’s line range.
Fields
file: Utf8PathBufFile the span pointed at.
MultiFileEditNotAllowed
An attempt edits more than one file without the multi-file flag.
DisallowedReplacement
A replacement would splice a top-level command into the edited file.
A single-span patch is a proof body; a column-zero command such as
#eval/#print/import/set_option/macro/elab/open is refused so
it cannot perturb the accept guards that read the compile.
Fields
file: Utf8PathBufFile the span pointed at.
RunnerSpawn
Starting the external agent runner failed.
RunnerProtocol
The runner broke the line-oriented request/response contract.
WorkspaceCopy
Copying the Lake project into an isolated workspace failed.
Fields
path: Utf8PathBufPath being copied when the failure happened.
Todo
Placeholder for code paths intentionally left as TODO.
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()