You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 16, 2021. It is now read-only.
Backtrace is too verbose and inefficient, we should provide another way to locate errors.
By adding at method to Fail, We can write the code such as:
use position::{here,Position};use failure::Fail;#[derive(Fail,Debug)]pubenumBar{// `Position` using for record error location#[fail(display="foo")]Foo(Position)}fncause_error() -> Bar{Bar::Foo(here!())}fnmain(){let err = cause_error();letmut fail:&Fail = &err;whileletSome(cause) = fail.cause(){let position = cause.at().map_or("...".to_owned(), |pos| pos.to_string());println!("\t{} at {}",cause, position);
fail = cause;}}