summaryrefslogtreecommitdiff
path: root/src/eval/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-06-14 20:07:27 +0200
committerLaurenz <laurmaedje@gmail.com>2022-06-14 20:07:27 +0200
commit7fb19d5ef8dc3b183d7de811e373768de56f7ee8 (patch)
tree885a94958e8270615aa57069b4d07db82e534b2c /src/eval/mod.rs
parent0dacb2d151e1790613b324b3051b8ce7aa26a90e (diff)
Unified file loading errors
Diffstat (limited to 'src/eval/mod.rs')
-rw-r--r--src/eval/mod.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/eval/mod.rs b/src/eval/mod.rs
index b1cf9e0b..e2090cd2 100644
--- a/src/eval/mod.rs
+++ b/src/eval/mod.rs
@@ -967,12 +967,7 @@ impl Eval for IncludeExpr {
fn import(vm: &mut Machine, path: &str, span: Span) -> TypResult<Module> {
// Load the source file.
let full = vm.locate(&path).at(span)?;
- let id = vm.ctx.sources.load(&full).map_err(|err| match err.kind() {
- std::io::ErrorKind::NotFound => {
- error!(span, "file not found (searched at {})", full.display())
- }
- _ => error!(span, "failed to load source file ({})", err),
- })?;
+ let id = vm.ctx.sources.load(&full).at(span)?;
// Prevent cyclic importing.
if vm.route.contains(&id) {