mirror of
https://github.com/haraldh/chainerror.git
synced 2025-05-29 21:18:07 +02:00
add more traits and macros
Namely: * ChainErrorFrom * IntoChainError * minto_cherr! * into_cherr! * strerr! Also make derive_str_cherr! struct public
This commit is contained in:
parent
f972b5f703
commit
a040044529
4 changed files with 104 additions and 5 deletions
|
@ -30,6 +30,7 @@ impl ::std::fmt::Display for Func1ErrorKind {
|
|||
}
|
||||
}
|
||||
}
|
||||
impl ::std::error::Error for Func1ErrorKind {}
|
||||
|
||||
fn func1() -> ChainResult<(), Func1ErrorKind> {
|
||||
func2().map_err(|e| cherr!(e, Func1ErrorKind::Func2))?;
|
||||
|
|
|
@ -36,6 +36,8 @@ impl ::std::fmt::Debug for Func1ErrorKind {
|
|||
}
|
||||
}
|
||||
|
||||
impl ::std::error::Error for Func1ErrorKind {}
|
||||
|
||||
fn func1() -> ChainResult<(), Func1ErrorKind> {
|
||||
func2().map_err(|e| cherr!(e, Func1ErrorKind::Func2))?;
|
||||
let filename = String::from("bar.txt");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue