use std::sync::PoisonError; #[derive(Debug)] pub enum UserError { DBInitFail(String), PoisonError(String), } impl std::convert::From for UserError { fn from(error: flowy_db::FlowyDBError) -> Self { UserError::DBInitFail(format!("{:?}", error)) } } impl std::convert::From> for UserError { fn from(error: PoisonError) -> Self { UserError::PoisonError(format!("{:?}", error)) } }