melib: add summary field to MeliError

pull/234/head
Manos Pitsidianakis 5 years ago
parent 7010ee7495
commit a059e4ad4c
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

@ -37,7 +37,8 @@ pub type Result<T> = result::Result<T, MeliError>;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct MeliError {
details: String,
pub summary: Option<String>,
pub details: String,
}
impl MeliError {
@ -46,9 +47,18 @@ impl MeliError {
M: Into<String>,
{
MeliError {
summary: None,
details: msg.into(),
}
}
pub fn set_summary<M>(mut self, summary: M) -> MeliError
where
M: Into<String>,
{
self.summary = Some(summary.into());
self
}
}
impl fmt::Display for MeliError {

Loading…
Cancel
Save