diff options
author | Vincent Ambo <mail@tazj.in> | 2022-12-12T14·57+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-12-21T22·37+0000 |
commit | 0ef3c2fc2beb65b594de2ebc2574776b20205494 (patch) | |
tree | f3cc9d9e6ed609b2b9a622476d9294dba8774a52 /tvix/eval/src/errors.rs | |
parent | c3c4d752c91f64eff8e7f7f7b21fbcc1209d27a6 (diff) |
refactor(tvix/eval): use EvalIO::read_to_string in impure builtins r/5460
With this change, the behaviour of reading a string from a file path is controlled by the provided `EvalIO` structure. This is a huge step towards abstracting away I/O behaviour correctly. Change-Id: Ifde8e46cd863b16e0301dca45a434ad27560399f Reviewed-on: https://cl.tvl.fyi/c/depot/+/7567 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'tvix/eval/src/errors.rs')
-rw-r--r-- | tvix/eval/src/errors.rs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs index 107b8b154abd..92ec7b079941 100644 --- a/tvix/eval/src/errors.rs +++ b/tvix/eval/src/errors.rs @@ -109,12 +109,6 @@ pub enum ErrorKind { /// literal attribute sets. UnmergeableValue, - /// Tvix failed to read a file from disk for some reason. - ReadFileError { - path: PathBuf, - error: Rc<std::io::Error>, - }, - /// Parse errors occured while importing a file. ImportParseError { path: PathBuf, @@ -342,15 +336,6 @@ to a missing value in the attribute set(s) included via `with`."#, ) } - ErrorKind::ReadFileError { path, error } => { - write!( - f, - "failed to read file '{}': {}", - path.to_string_lossy(), - error - ) - } - // Errors themselves ignored here & handled in Self::spans instead ErrorKind::ImportParseError { path, .. } => { write!( @@ -676,7 +661,6 @@ impl Error { | ErrorKind::NegativeLength { .. } | ErrorKind::UnmergeableInherit { .. } | ErrorKind::UnmergeableValue - | ErrorKind::ReadFileError { .. } | ErrorKind::ImportParseError { .. } | ErrorKind::ImportCompilerError { .. } | ErrorKind::IO { .. } @@ -716,7 +700,6 @@ impl Error { ErrorKind::TailEmptyList { .. } => "E023", ErrorKind::UnmergeableInherit { .. } => "E024", ErrorKind::UnmergeableValue => "E025", - ErrorKind::ReadFileError { .. } => "E026", ErrorKind::ImportParseError { .. } => "E027", ErrorKind::ImportCompilerError { .. } => "E028", ErrorKind::IO { .. } => "E029", |