Module myutil::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

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

Statics

INFO or ERROR, if mismatch, default to INFO

Traits

the major trait defination
Convert all Result to this

Type Definitions

Custom Result