Module err

Source
Expand description

§Error management

All errors will be converted to RucError.

§Example

use ruc::*;

#[derive(Debug, Eq, PartialEq)]
struct CustomErr(i32);

fn will_panic() {
    let l1 = || -> Result<()> { Err(eg!("The final error message!")) };
    let l2 = || -> Result<()> { l1().c(d!()) };
    let l3 = || -> Result<()> { l2().c(d!("A custom message!")) };
    let l4 = || -> Result<()> { l3().c(d!("ERR_UNKNOWN")) };
    let l5 = || -> Result<()> { l4().c(d!("{:?}", CustomErr(-1))) };

    pnk!(l5());
}

Structs§

SimpleError
A pre-impled Error
SimpleMsg
error + <file + line + column>

Statics§

LOG_LEVEL
INFO or ERROR, if mismatch, default to INFO

Traits§

RucError
the major trait defination
RucResult
Convert all Result to this

Type Aliases§

Result
Custom Result