Merge pull request #345 from Flowdalic/mount-print-error

mount: print a helpful error message
This commit is contained in:
koverstreet 2024-12-29 16:16:25 -05:00 committed by GitHub
commit 7210d5c911
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,7 @@ use std::{
use anyhow::{ensure, Result};
use bch_bindgen::{bcachefs, bcachefs::bch_sb_handle, opt_set, path_to_cstr};
use clap::Parser;
use log::{debug, info};
use log::{debug, error, info};
use uuid::Uuid;
use crate::{
@ -385,6 +385,9 @@ pub fn mount(mut argv: Vec<String>, symlink_cmd: Option<&str>) -> std::process::
match cmd_mount_inner(&cli) {
Ok(_) => std::process::ExitCode::SUCCESS,
Err(_) => std::process::ExitCode::FAILURE,
Err(e) => {
error!("Mount failed: {e}");
std::process::ExitCode::FAILURE
}
}
}