#error #test

iceyee_error

Error Message

9 stable releases (3 major)

11.0.0 Sep 28, 2024
10.0.0 Sep 25, 2024
3.0.2 Nov 26, 2023
1.0.3 Nov 11, 2022

#66 in #test


Used in 2 crates

Apache-2.0

6KB

创建异常和继承异常, [a], [b].

Example

#[test]
pub fn a() {
    println!("");
    let a001 = iceyee_error::a!();
    let a002 = iceyee_error::a!("hello world");
    let a003 = iceyee_error::a!("hello", "world");
    let a004 = iceyee_error::b!(&a003, "how", "are", "you");
    let a005 = iceyee_error::b!(&a004, "thank", "you");
    let a006 = iceyee_error::b!(&a005);
    println!("创建默认异常");
    println!("{}", a001);
    println!("创建异常, 参数'hello world'");
    println!("{}", a002);
    println!("创建异常, 参数'hello', 'world'");
    println!("{}", a003);
    println!("继承异常, 参数'how', 'are', 'you'");
    println!("{}", a004);
    println!("继承异常, 参数'thank', 'you'");
    println!("{}", a005);
    println!("继承异常, 无参数");
    println!("{}", a006);
    return;
}

Output

创建默认异常
Create error at iceyee_error/tests/test_a.rs:20:16
创建异常, 参数'hello world'
Create error at iceyee_error/tests/test_a.rs:21:16, hello world
创建异常, 参数'hello', 'world'
Create error at iceyee_error/tests/test_a.rs:22:16, hello, world
继承异常, 参数'how', 'are', 'you'
Create error at iceyee_error/tests/test_a.rs:22:16, hello, world
Inherit error at iceyee_error/tests/test_a.rs:23:16, how, are, you
继承异常, 参数'thank', 'you'
Create error at iceyee_error/tests/test_a.rs:22:16, hello, world
Inherit error at iceyee_error/tests/test_a.rs:23:16, how, are, you
Inherit error at iceyee_error/tests/test_a.rs:24:16, thank, you
继承异常, 无参数
Create error at iceyee_error/tests/test_a.rs:22:16, hello, world
Inherit error at iceyee_error/tests/test_a.rs:23:16, how, are, you
Inherit error at iceyee_error/tests/test_a.rs:24:16, thank, you
Inherit error at iceyee_error/tests/test_a.rs:25:16

No runtime deps