mirror of
https://github.com/denisidoro/navi.git
synced 2026-07-25 11:04:06 +00:00
22 lines
535 B
Rust
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(),
|
|
}
|
|
}
|
|
}
|