macro_rules! error {
(code: $code: expr, msg: $msg: expr) => { ... };
(code: $code: expr, msg: $msg: expr,) => { ... };
($($arg:tt)*) => { ... };
}Expand description
impl From<&str> for ChimesError {
fn from(e: &str) -> Self {
Self::msg(e)
}
}
impl From
impl Fromrbatis::Error for ChimesError { fn from(e: rbatis::Error) -> Self { Self { kind: ErrorKind::Msg(e.to_string()), source: Some(Box::new(e)), } } }
impl From<actix_web::Error> for ChimesError { fn from(e: actix_web::Error) -> Self { let resp: Error = e.into(); let msg = resp.to_string(); let http: HttpResponse = resp.into(); Self { kind: ErrorKind::Custom { code: http.status().as_u16() as i32, msg: msg }, source: None, } } } 获取错误信息对象