Updated error to be more expressive.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
This commit is contained in:
15
src/lib.rs
15
src/lib.rs
@@ -24,9 +24,14 @@ pub use queue::data_director::{Include, Path};
|
||||
|
||||
#[cfg(test)]
|
||||
mod support_tests {
|
||||
use super::*;
|
||||
use std::time::Duration;
|
||||
|
||||
pub static TIMEOUT: Duration = Duration::from_millis(500);
|
||||
|
||||
pub fn random_name() -> Name {
|
||||
Name::english(Uuid::new_v4().to_string().as_str())
|
||||
}
|
||||
}
|
||||
|
||||
static TIMEOUT: Duration = Duration::from_secs(10);
|
||||
@@ -127,7 +132,7 @@ impl MoreThanText {
|
||||
MsgAction::Error(err) => Err(err.clone()),
|
||||
_ => unreachable!("should only receive records or errors"),
|
||||
},
|
||||
Err(_) => Err(MTTError::new(NameType::None, ErrorID::TimeOut)),
|
||||
Err(_) => Err(MTTError::new(ErrorID::TimeOut)),
|
||||
};
|
||||
self.queue.remove_sender(&sender_id);
|
||||
output
|
||||
@@ -162,7 +167,7 @@ impl MoreThanText {
|
||||
MsgAction::Error(err) => Err(err.clone()),
|
||||
_ => unreachable!("should only receive records or errors"),
|
||||
},
|
||||
Err(_) => Err(MTTError::new(NameType::None, ErrorID::TimeOut)),
|
||||
Err(_) => Err(MTTError::new(ErrorID::TimeOut)),
|
||||
};
|
||||
self.queue.remove_sender(&sender_id);
|
||||
output
|
||||
@@ -172,7 +177,7 @@ impl MoreThanText {
|
||||
if name == "page" {
|
||||
Ok("something".to_string())
|
||||
} else {
|
||||
Err(MTTError::new(NameType::None, ErrorID::DocumentNotFound))
|
||||
Err(MTTError::new(ErrorID::DocumentNotFound))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,10 +217,6 @@ impl TestMoreThanText {
|
||||
self.queue.send(msg);
|
||||
}
|
||||
|
||||
pub fn random_name() -> Name {
|
||||
Name::english(Uuid::new_v4().to_string().as_str())
|
||||
}
|
||||
|
||||
pub fn register_channel(&self, paths: Vec<Path>) -> Receiver<Message> {
|
||||
let mut queue = self.mtt.queue.clone();
|
||||
let (tx, rx) = channel();
|
||||
|
||||
Reference in New Issue
Block a user