Skip to content

Commit 8379383

Browse files
committed
Add a custom error messagefield to exit
1 parent e9161ca commit 8379383

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ pub type Result<T = (), E = Exit> = std::result::Result<T, E>;
1616
pub enum Exit {
1717
ArgError(sap::ParsingError),
1818
IoError(io::Error),
19+
Custom(&'static str),
1920
}
2021

2122
impl Debug for Exit {
2223
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2324
match self {
2425
Self::ArgError(err) => Display::fmt(err, f),
2526
Self::IoError(err) => Display::fmt(err, f),
27+
Self::Custom(err) => Display::fmt(err, f),
2628
}
2729
}
2830
}

0 commit comments

Comments
 (0)