Better Vagrant error handling

This commit is contained in:
Roey Darwish Dror
2020-06-25 08:37:29 +03:00
parent 124b3f2506
commit 4fff6ba56f
3 changed files with 12 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ use crate::executor::CommandExt;
use crate::terminal::print_separator;
use crate::{error::SkipStep, utils};
use anyhow::Result;
use log::debug;
use log::{debug, error};
use std::path::{Path, PathBuf};
use std::process::Command;
use std::{fmt::Display, rc::Rc, str::FromStr};
@@ -159,8 +159,12 @@ pub fn collect_boxes(ctx: &ExecutionContext) -> Result<Vec<VagrantBox>> {
let mut result = Vec::new();
for directory in directories {
let mut boxes = vagrant.get_boxes(directory)?;
result.append(&mut boxes);
match vagrant.get_boxes(directory) {
Ok(mut boxes) => {
result.append(&mut boxes);
}
Err(e) => error!("Error collecting vagrant boxes from {}: {}", directory, e),
};
}
Ok(result)