mirror of
https://github.com/haraldh/chainerror.git
synced 2025-01-31 00:56:41 +01:00
add dyn
This commit is contained in:
parent
3e270f1e1a
commit
1d43a39c61
|
@ -4,12 +4,12 @@ use std::result::Result;
|
||||||
|
|
||||||
use chainerror::*;
|
use chainerror::*;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func3() -> Result<(), Box<Error + Send + Sync>> {
|
fn func3() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -2,25 +2,25 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(_) = do_some_io() {
|
if let Err(_) = do_some_io() {
|
||||||
Err("func2 error")?;
|
Err("func2 error")?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(_) = func2() {
|
if let Err(_) = func2() {
|
||||||
Err("func1 error")?;
|
Err("func1 error")?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
func1()
|
func1()
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,14 +3,14 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
derive_str_cherr!(Func2Error);
|
derive_str_cherr!(Func2Error);
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -39,7 +39,7 @@ fn func1() -> ChainResult<(), Func1ErrorKind> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func1() {
|
if let Err(e) = func1() {
|
||||||
match e.kind() {
|
match e.kind() {
|
||||||
Func1ErrorKind::Func2 => eprintln!("Main Error Report: func1 error calling func2"),
|
Func1ErrorKind::Func2 => eprintln!("Main Error Report: func1 error calling func2"),
|
||||||
|
|
|
@ -3,14 +3,14 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
derive_str_cherr!(Func2Error);
|
derive_str_cherr!(Func2Error);
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -45,7 +45,7 @@ fn func1() -> ChainResult<(), Func1ErrorKind> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func1() {
|
if let Err(e) = func1() {
|
||||||
match e.kind() {
|
match e.kind() {
|
||||||
Func1ErrorKind::Func2 => eprintln!("Main Error Report: func1 error calling func2"),
|
Func1ErrorKind::Func2 => eprintln!("Main Error Report: func1 error calling func2"),
|
||||||
|
|
|
@ -3,14 +3,14 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
derive_str_cherr!(Func2Error);
|
derive_str_cherr!(Func2Error);
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -54,7 +54,7 @@ fn handle_func1errorkind(e: &Func1ErrorKind) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func1() {
|
if let Err(e) = func1() {
|
||||||
match *e {
|
match *e {
|
||||||
Func1ErrorKind::Func2 => eprintln!("Main Error Report: func1 error calling func2"),
|
Func1ErrorKind::Func2 => eprintln!("Main Error Report: func1 error calling func2"),
|
||||||
|
|
|
@ -2,14 +2,14 @@ pub mod mycrate {
|
||||||
use chainerror::*;
|
use chainerror::*;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
fn do_some_io() -> std::result::Result<(), Box<std::error::Error + Send + Sync>> {
|
fn do_some_io() -> std::result::Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
derive_str_cherr!(Func2Error);
|
derive_str_cherr!(Func2Error);
|
||||||
|
|
||||||
fn func2() -> std::result::Result<(), Box<std::error::Error + Send + Sync>> {
|
fn func2() -> std::result::Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -42,7 +42,7 @@ pub mod mycrate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<std::error::Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
use mycrate::func1;
|
use mycrate::func1;
|
||||||
use mycrate::ErrorKind;
|
use mycrate::ErrorKind;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
@ -57,7 +57,7 @@ fn main() -> Result<(), Box<std::error::Error + Send + Sync>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
eprintln!();
|
eprintln!();
|
||||||
let mut s: &Error = &e;
|
let mut s: &dyn Error = &e;
|
||||||
while let Some(c) = s.source() {
|
while let Some(c) = s.source() {
|
||||||
if let Some(ioerror) = c.downcast_ref::<io::Error>() {
|
if let Some(ioerror) = c.downcast_ref::<io::Error>() {
|
||||||
eprintln!("caused by: std::io::Error: {}", ioerror);
|
eprintln!("caused by: std::io::Error: {}", ioerror);
|
||||||
|
|
|
@ -182,7 +182,7 @@ pub mod mycrate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<std::error::Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
use mycrate::func1;
|
use mycrate::func1;
|
||||||
use mycrate::ErrorKind;
|
use mycrate::ErrorKind;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
@ -197,7 +197,7 @@ fn main() -> Result<(), Box<std::error::Error + Send + Sync>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
eprintln!();
|
eprintln!();
|
||||||
let mut s: &Error = &e;
|
let mut s: &dyn Error = &e;
|
||||||
while let Some(c) = s.source() {
|
while let Some(c) = s.source() {
|
||||||
if let Some(ioerror) = c.downcast_ref::<io::Error>() {
|
if let Some(ioerror) = c.downcast_ref::<io::Error>() {
|
||||||
eprintln!("caused by: std::io::Error: {}", ioerror);
|
eprintln!("caused by: std::io::Error: {}", ioerror);
|
||||||
|
|
|
@ -10,7 +10,7 @@ pub mod mycrate {
|
||||||
|
|
||||||
derive_str_cherr!(Func2Error);
|
derive_str_cherr!(Func2Error);
|
||||||
|
|
||||||
fn func2() -> std::result::Result<(), Box<std::error::Error + Send + Sync>> {
|
fn func2() -> std::result::Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io(filename)
|
do_some_io(filename)
|
||||||
.map_err(|e| cherr!(e, Func2Error(format!("Error reading '{}'", filename))))?;
|
.map_err(|e| cherr!(e, Func2Error(format!("Error reading '{}'", filename))))?;
|
||||||
|
@ -52,7 +52,7 @@ pub mod mycrate {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<&(dyn std::error::Error + 'static + Send + Sync)> for ErrorKind {
|
impl From<&(dyn std::error::Error + 'static + Send + Sync)> for ErrorKind {
|
||||||
fn from(e: &(dyn std::error::Error + 'static + Send + Sync)) -> Self {
|
fn from(e: &(dyn std::error::Error + 'static + Send + Sync)) -> Self {
|
||||||
if let Some(_) = e.downcast_ref::<io::Error>() {
|
if let Some(_) = e.downcast_ref::<io::Error>() {
|
||||||
ErrorKind::IO(String::from("Unknown filename"))
|
ErrorKind::IO(String::from("Unknown filename"))
|
||||||
} else if let Some(_) = e.downcast_inner_ref::<Func2Error>() {
|
} else if let Some(_) = e.downcast_inner_ref::<Func2Error>() {
|
||||||
|
@ -63,8 +63,8 @@ pub mod mycrate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<&std::boxed::Box<dyn std::error::Error + 'static + Send + Sync>> for ErrorKind {
|
impl From<&std::boxed::Box<dyn std::error::Error + 'static + Send + Sync>> for ErrorKind {
|
||||||
fn from(e: &std::boxed::Box<dyn std::error::Error + 'static + Send + Sync>) -> Self {
|
fn from(e: &std::boxed::Box<dyn std::error::Error + 'static + Send + Sync>) -> Self {
|
||||||
Self::from(&**e)
|
Self::from(&**e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,10 +99,9 @@ pub mod mycrate {
|
||||||
func1().map_err(minto_cherr!(ErrorKind))?;
|
func1().map_err(minto_cherr!(ErrorKind))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<std::error::Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
use mycrate::super_func1;
|
use mycrate::super_func1;
|
||||||
use mycrate::ErrorKind;
|
use mycrate::ErrorKind;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
@ -119,7 +118,7 @@ fn main() -> Result<(), Box<std::error::Error + Send + Sync>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
eprintln!();
|
eprintln!();
|
||||||
let mut s: &Error = &e;
|
let mut s: &dyn Error = &e;
|
||||||
while let Some(c) = s.source() {
|
while let Some(c) = s.source() {
|
||||||
if let Some(ioerror) = c.downcast_ref::<io::Error>() {
|
if let Some(ioerror) = c.downcast_ref::<io::Error>() {
|
||||||
eprintln!("caused by: std::io::Error: {}", ioerror);
|
eprintln!("caused by: std::io::Error: {}", ioerror);
|
||||||
|
|
|
@ -4,25 +4,25 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = do_some_io() {
|
if let Err(e) = do_some_io() {
|
||||||
Err(cherr!(e, "func2 error"))?;
|
Err(cherr!(e, "func2 error"))?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func2() {
|
if let Err(e) = func2() {
|
||||||
Err(cherr!(e, "func1 error"))?;
|
Err(cherr!(e, "func1 error"))?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
func1()
|
func1()
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,22 +4,22 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
do_some_io().map_err(|e| cherr!(e, "func2 error"))?;
|
do_some_io().map_err(|e| cherr!(e, "func2 error"))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
func2().map_err(|e| cherr!(e, "func1 error"))?;
|
func2().map_err(|e| cherr!(e, "func1 error"))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func1() {
|
if let Err(e) = func1() {
|
||||||
eprintln!("{:?}", e);
|
eprintln!("{:?}", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,23 +3,23 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
func2().map_err(mstrerr!("func1 error"))?;
|
func2().map_err(mstrerr!("func1 error"))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func1() {
|
if let Err(e) = func1() {
|
||||||
eprintln!("{:?}", e);
|
eprintln!("{:?}", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,18 +3,18 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func2() {
|
if let Err(e) = func2() {
|
||||||
if let Some(s) = e.source() {
|
if let Some(s) = e.source() {
|
||||||
eprintln!("func2 failed because of '{}'", s);
|
eprintln!("func2 failed because of '{}'", s);
|
||||||
|
@ -24,7 +24,7 @@ fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func1() {
|
if let Err(e) = func1() {
|
||||||
eprintln!("{}", e);
|
eprintln!("{}", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,26 +3,26 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
func2().map_err(mstrerr!("func1 error"))?;
|
func2().map_err(mstrerr!("func1 error"))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func1() {
|
if let Err(e) = func1() {
|
||||||
eprintln!("Error: {}", e);
|
eprintln!("Error: {}", e);
|
||||||
let mut s : &(dyn Error) = e.as_ref();
|
let mut s: &(dyn Error) = e.as_ref();
|
||||||
while let Some(c) = s.source() {
|
while let Some(c) = s.source() {
|
||||||
if let Some(ioerror) = c.downcast_ref::<io::Error>() {
|
if let Some(ioerror) = c.downcast_ref::<io::Error>() {
|
||||||
eprintln!("caused by: std::io::Error: {}", ioerror);
|
eprintln!("caused by: std::io::Error: {}", ioerror);
|
||||||
|
|
|
@ -3,23 +3,23 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
func2().map_err(mstrerr!("func1 error"))?;
|
func2().map_err(mstrerr!("func1 error"))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func1() {
|
if let Err(e) = func1() {
|
||||||
eprintln!("Error: {}", e);
|
eprintln!("Error: {}", e);
|
||||||
if let Some(s) = e.downcast_chain_ref::<String>() {
|
if let Some(s) = e.downcast_chain_ref::<String>() {
|
||||||
|
|
|
@ -3,14 +3,14 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
derive_str_cherr!(Func2Error);
|
derive_str_cherr!(Func2Error);
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -18,12 +18,12 @@ fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
||||||
|
|
||||||
derive_str_cherr!(Func1Error);
|
derive_str_cherr!(Func1Error);
|
||||||
|
|
||||||
fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
func2().map_err(mstrerr!(Func1Error, "func1 error"))?;
|
func2().map_err(mstrerr!(Func1Error, "func1 error"))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func1() {
|
if let Err(e) = func1() {
|
||||||
if let Some(f1err) = e.downcast_chain_ref::<Func1Error>() {
|
if let Some(f1err) = e.downcast_chain_ref::<Func1Error>() {
|
||||||
eprintln!("Func1Error: {}", f1err);
|
eprintln!("Func1Error: {}", f1err);
|
||||||
|
|
|
@ -3,14 +3,14 @@ use std::error::Error;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
derive_str_cherr!(Func2Error);
|
derive_str_cherr!(Func2Error);
|
||||||
|
|
||||||
fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let filename = "foo.txt";
|
let filename = "foo.txt";
|
||||||
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -19,14 +19,14 @@ fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
||||||
derive_str_cherr!(Func1ErrorFunc2);
|
derive_str_cherr!(Func1ErrorFunc2);
|
||||||
derive_str_cherr!(Func1ErrorIO);
|
derive_str_cherr!(Func1ErrorIO);
|
||||||
|
|
||||||
fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
func2().map_err(mstrerr!(Func1ErrorFunc2, "func1 error calling func2"))?;
|
func2().map_err(mstrerr!(Func1ErrorFunc2, "func1 error calling func2"))?;
|
||||||
let filename = "bar.txt";
|
let filename = "bar.txt";
|
||||||
do_some_io().map_err(mstrerr!(Func1ErrorIO, "Error reading '{}'", filename))?;
|
do_some_io().map_err(mstrerr!(Func1ErrorIO, "Error reading '{}'", filename))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), Box<Error + Send + Sync>> {
|
fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
if let Err(e) = func1() {
|
if let Err(e) = func1() {
|
||||||
if let Some(s) = e.downcast_ref::<ChainError<Func1ErrorIO>>() {
|
if let Some(s) = e.downcast_ref::<ChainError<Func1ErrorIO>>() {
|
||||||
eprintln!("Func1ErrorIO:\n{:?}", s);
|
eprintln!("Func1ErrorIO:\n{:?}", s);
|
||||||
|
|
40
src/lib.rs
40
src/lib.rs
|
@ -32,18 +32,18 @@
|
||||||
//! use std::io;
|
//! use std::io;
|
||||||
//! use std::result::Result;
|
//! use std::result::Result;
|
||||||
//!
|
//!
|
||||||
//! fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
//! fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
//! Err(io::Error::from(io::ErrorKind::NotFound))?;
|
//! Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
//! Ok(())
|
//! Ok(())
|
||||||
//! }
|
//! }
|
||||||
//!
|
//!
|
||||||
//! fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
//! fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
//! let filename = "foo.txt";
|
//! let filename = "foo.txt";
|
||||||
//! do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
//! do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
||||||
//! Ok(())
|
//! Ok(())
|
||||||
//! }
|
//! }
|
||||||
//!
|
//!
|
||||||
//! fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
//! fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
//! func2().map_err(mstrerr!("func1 error"))?;
|
//! func2().map_err(mstrerr!("func1 error"))?;
|
||||||
//! Ok(())
|
//! Ok(())
|
||||||
//! }
|
//! }
|
||||||
|
@ -74,12 +74,12 @@
|
||||||
//! use std::io;
|
//! use std::io;
|
||||||
//! use std::result::Result;
|
//! use std::result::Result;
|
||||||
//!
|
//!
|
||||||
//! fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
//! fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
//! Err(io::Error::from(io::ErrorKind::NotFound))?;
|
//! Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
//! Ok(())
|
//! Ok(())
|
||||||
//! }
|
//! }
|
||||||
//!
|
//!
|
||||||
//! fn func3() -> Result<(), Box<Error + Send + Sync>> {
|
//! fn func3() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
//! let filename = "foo.txt";
|
//! let filename = "foo.txt";
|
||||||
//! do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
//! do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
||||||
//! Ok(())
|
//! Ok(())
|
||||||
|
@ -246,14 +246,14 @@ impl<T: 'static + Display + Debug> ChainError<T> {
|
||||||
/// use std::error::Error;
|
/// use std::error::Error;
|
||||||
/// use std::io;
|
/// use std::io;
|
||||||
///
|
///
|
||||||
/// fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
/// fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// Err(io::Error::from(io::ErrorKind::NotFound))?;
|
/// Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// derive_str_cherr!(Func2Error);
|
/// derive_str_cherr!(Func2Error);
|
||||||
///
|
///
|
||||||
/// fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
/// fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// let filename = "foo.txt";
|
/// let filename = "foo.txt";
|
||||||
/// do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
/// do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
|
@ -261,7 +261,7 @@ impl<T: 'static + Display + Debug> ChainError<T> {
|
||||||
///
|
///
|
||||||
/// derive_str_cherr!(Func1Error);
|
/// derive_str_cherr!(Func1Error);
|
||||||
///
|
///
|
||||||
/// fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
/// fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// func2().map_err(mstrerr!(Func1Error, "func1 error"))?;
|
/// func2().map_err(mstrerr!(Func1Error, "func1 error"))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
|
@ -351,14 +351,14 @@ impl<T: 'static + Display + Debug> ChainError<T> {
|
||||||
/// use std::error::Error;
|
/// use std::error::Error;
|
||||||
/// use std::io;
|
/// use std::io;
|
||||||
///
|
///
|
||||||
/// fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
/// fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// Err(io::Error::from(io::ErrorKind::NotFound))?;
|
/// Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// derive_str_cherr!(Func2Error);
|
/// derive_str_cherr!(Func2Error);
|
||||||
///
|
///
|
||||||
/// fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
/// fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// let filename = "foo.txt";
|
/// let filename = "foo.txt";
|
||||||
/// do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
/// do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
|
@ -801,7 +801,7 @@ macro_rules! minto_cherr {
|
||||||
/// # }
|
/// # }
|
||||||
/// # }
|
/// # }
|
||||||
/// # }
|
/// # }
|
||||||
/// fn do_some_stuff() -> Result<(), Box<Error + Send + Sync>> {
|
/// fn do_some_stuff() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// Err(io::Error::from(io::ErrorKind::NotFound))?;
|
/// Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
|
@ -850,17 +850,17 @@ macro_rules! cherr {
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # use std::io;
|
/// # use std::io;
|
||||||
/// # use std::result::Result;
|
/// # use std::result::Result;
|
||||||
/// # fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
/// # fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// # Err(io::Error::from(io::ErrorKind::NotFound))?;
|
/// # Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
/// fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
/// fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// let filename = "foo.txt";
|
/// let filename = "foo.txt";
|
||||||
/// do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
/// do_some_io().map_err(mstrerr!("Error reading '{}'", filename))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
/// fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// func2().map_err(mstrerr!("func1 error"))?;
|
/// func2().map_err(mstrerr!("func1 error"))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
|
@ -891,13 +891,13 @@ macro_rules! cherr {
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # use std::io;
|
/// # use std::io;
|
||||||
/// # use std::result::Result;
|
/// # use std::result::Result;
|
||||||
/// # fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
/// # fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// # Err(io::Error::from(io::ErrorKind::NotFound))?;
|
/// # Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
/// derive_str_cherr!(Func2Error);
|
/// derive_str_cherr!(Func2Error);
|
||||||
///
|
///
|
||||||
/// fn func2() -> Result<(), Box<Error + Send + Sync>> {
|
/// fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// let filename = "foo.txt";
|
/// let filename = "foo.txt";
|
||||||
/// do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
/// do_some_io().map_err(mstrerr!(Func2Error, "Error reading '{}'", filename))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
|
@ -905,7 +905,7 @@ macro_rules! cherr {
|
||||||
///
|
///
|
||||||
/// derive_str_cherr!(Func1Error);
|
/// derive_str_cherr!(Func1Error);
|
||||||
///
|
///
|
||||||
/// fn func1() -> Result<(), Box<Error + Send + Sync>> {
|
/// fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// func2().map_err(mstrerr!(Func1Error, "func1 error"))?;
|
/// func2().map_err(mstrerr!(Func1Error, "func1 error"))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
|
@ -961,7 +961,7 @@ macro_rules! mstrerr {
|
||||||
///
|
///
|
||||||
/// derive_str_cherr!(Func1Error);
|
/// derive_str_cherr!(Func1Error);
|
||||||
///
|
///
|
||||||
/// fn func1() -> Result<(), Box<Error>> {
|
/// fn func1() -> Result<(), Box<dyn Error>> {
|
||||||
/// func2().map_err(mstrerr!(Func1Error, "func1 error"))?;
|
/// func2().map_err(mstrerr!(Func1Error, "func1 error"))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
|
@ -1009,7 +1009,7 @@ macro_rules! strerr {
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # use std::io;
|
/// # use std::io;
|
||||||
/// # use std::result::Result;
|
/// # use std::result::Result;
|
||||||
/// # fn do_some_io() -> Result<(), Box<Error + Send + Sync>> {
|
/// # fn do_some_io() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
/// # Err(io::Error::from(io::ErrorKind::NotFound))?;
|
/// # Err(io::Error::from(io::ErrorKind::NotFound))?;
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
|
@ -1023,7 +1023,7 @@ macro_rules! strerr {
|
||||||
///
|
///
|
||||||
/// derive_str_cherr!(Func1Error);
|
/// derive_str_cherr!(Func1Error);
|
||||||
///
|
///
|
||||||
/// fn func1() -> Result<(), Box<Error>> {
|
/// fn func1() -> Result<(), Box<dyn Error>> {
|
||||||
/// func2().map_err(mstrerr!(Func1Error, "func1 error"))?;
|
/// func2().map_err(mstrerr!(Func1Error, "func1 error"))?;
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::fmt::Write;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_iter() -> Result<(), Box<Error + Send + Sync>> {
|
fn test_iter() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let err = io::Error::from(io::ErrorKind::NotFound);
|
let err = io::Error::from(io::ErrorKind::NotFound);
|
||||||
let err = cherr!(err, "1");
|
let err = cherr!(err, "1");
|
||||||
let err = cherr!(err, "2");
|
let err = cherr!(err, "2");
|
||||||
|
@ -31,7 +31,7 @@ fn test_iter() -> Result<(), Box<Error + Send + Sync>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_find_cause() -> Result<(), Box<Error + Send + Sync>> {
|
fn test_find_cause() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let err = io::Error::from(io::ErrorKind::NotFound);
|
let err = io::Error::from(io::ErrorKind::NotFound);
|
||||||
let err = cherr!(err, "1");
|
let err = cherr!(err, "1");
|
||||||
let err = cherr!(err, "2");
|
let err = cherr!(err, "2");
|
||||||
|
@ -48,7 +48,7 @@ fn test_find_cause() -> Result<(), Box<Error + Send + Sync>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_root_cause() -> Result<(), Box<Error + Send + Sync>> {
|
fn test_root_cause() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
let err = io::Error::from(io::ErrorKind::NotFound);
|
let err = io::Error::from(io::ErrorKind::NotFound);
|
||||||
let err = cherr!(err, "1");
|
let err = cherr!(err, "1");
|
||||||
let err = cherr!(err, "2");
|
let err = cherr!(err, "2");
|
||||||
|
|
Loading…
Reference in a new issue