Made MTTError a proper Error structure.
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:
@@ -1,6 +1,6 @@
|
||||
use morethantext::{
|
||||
action::{DocDef, FieldType, Query},
|
||||
MTTError, MoreThanText, Name,
|
||||
ErrorID, MTTError, MoreThanText, Name,
|
||||
};
|
||||
use uuid::Uuid;
|
||||
|
||||
@@ -10,10 +10,13 @@ fn errors_on_missing_page() {
|
||||
let doc_name = "missing";
|
||||
match mtt.get_document(doc_name, "something") {
|
||||
Ok(data) => assert!(false, "got '{}', should have been not found error", data),
|
||||
Err(err) => match err {
|
||||
MTTError::DocumentNotFound(result) => assert_eq!(result, doc_name),
|
||||
_ => unreachable!("got {:?}, should have been not found", err),
|
||||
},
|
||||
Err(err) => {
|
||||
let err_id = err.error_id();
|
||||
match err_id {
|
||||
ErrorID::DocumentNotFound => {}
|
||||
_ => unreachable!("got {:?}, should have been not found", err),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user