feat: add images, error_box & new message when no results are provided (#185)

This commit is contained in:
neon_arch 2023-08-10 04:32:47 +03:00
parent 9fd8275b17
commit c4935f202a
8 changed files with 67 additions and 4 deletions

View file

@ -116,10 +116,12 @@ impl RawSearchResult {
}
}
///
#[derive(Serialize, Deserialize)]
pub struct EngineErrorInfo {
pub error: String,
pub engine: String,
pub severity_color: String,
}
impl EngineErrorInfo {
@ -131,6 +133,11 @@ impl EngineErrorInfo {
EngineError::UnexpectedError => String::from("UnexpectedError"),
},
engine,
severity_color: match error {
EngineError::RequestError => String::from("green"),
EngineError::EmptyResultSet => String::from("blue"),
EngineError::UnexpectedError => String::from("red"),
},
}
}
}