navi/src/structures/error/command.rs
2020-03-22 22:16:30 +01:00

22 lines
535 B
Rust

use std::fmt::Debug;
use thiserror::Error;
#[derive(Error, Debug)]
#[error("Failed to spawn child process `bash` to execute `{command}`")]
pub struct BashSpawnError {
command: String,
#[source]
source: anyhow::Error,
}
impl BashSpawnError {
pub fn new<SourceError>(command: impl Into<String>, source: SourceError) -> Self
where
SourceError: std::error::Error + Sync + Send + 'static,
{
BashSpawnError {
command: command.into(),
source: source.into(),
}
}
}