Improve error message

This commit is contained in:
Hanno Braun 2022-04-13 16:16:30 +02:00
parent 5e8e264686
commit 136507aa6a

View File

@ -3,7 +3,7 @@ mod config;
use std::path::PathBuf;
use anyhow::anyhow;
use anyhow::{anyhow, Context as _};
use fj_export::export;
use fj_host::{Model, Parameters};
use fj_operations::shape_processor::ShapeProcessor;
@ -39,7 +39,8 @@ fn main() -> anyhow::Result<()> {
})?;
path.push(model);
let model = Model::from_path(path, config.target_dir)?;
let model = Model::from_path(path.clone(), config.target_dir)
.with_context(|| format!("Failed to load model: {}", path.display()))?;
let parameters = args.parameters.unwrap_or_else(Parameters::empty);
let shape_processor = ShapeProcessor {