Rename the error to NoSuchEngineFound and add the name of missing engine to it

This commit is contained in:
Zsombor Gegesy 2023-10-08 22:30:31 +02:00
parent 8ed4c9e206
commit f56002dca6
2 changed files with 10 additions and 6 deletions

View file

@ -85,14 +85,14 @@ impl EngineErrorInfo {
pub fn new(error: &EngineError, engine: &str) -> Self {
Self {
error: match error {
EngineError::EngineNotFound => "EngineNotFound".to_owned(),
EngineError::NoSuchEngineFound(_) => "EngineNotFound".to_owned(),
EngineError::RequestError => "RequestError".to_owned(),
EngineError::EmptyResultSet => "EmptyResultSet".to_owned(),
EngineError::UnexpectedError => "UnexpectedError".to_owned(),
},
engine: engine.to_owned(),
severity_color: match error {
EngineError::EngineNotFound => "red".to_owned(),
EngineError::NoSuchEngineFound(_) => "red".to_owned(),
EngineError::RequestError => "green".to_owned(),
EngineError::EmptyResultSet => "blue".to_owned(),
EngineError::UnexpectedError => "red".to_owned(),