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:
@@ -191,10 +191,10 @@ mod messages {
|
||||
let name = Name::english("testing");
|
||||
let msg = Message::new(Query::new(name.clone()));
|
||||
let err_msg = Uuid::new_v4().to_string();
|
||||
let result = msg.response(MTTError::new(NameType::None, ErrorID::DocumentNotFound));
|
||||
let result = msg.response(MTTError::new(ErrorID::DocumentNotFound));
|
||||
assert_eq!(result.get_message_id(), msg.get_message_id());
|
||||
match result.get_action() {
|
||||
MsgAction::Error(data) => match data.error_id() {
|
||||
MsgAction::Error(data) => match data.get_error_ids().back().unwrap() {
|
||||
ErrorID::DocumentNotFound => {}
|
||||
_ => unreachable!("got {:?}, should have received not found", data),
|
||||
},
|
||||
@@ -207,13 +207,13 @@ mod messages {
|
||||
let doc_id = Uuid::new_v4();
|
||||
let msg = Message::new(Query::new(doc_id.clone()));
|
||||
let data = Uuid::new_v4().to_string();
|
||||
let result1 = msg.response(MTTError::new(NameType::None, ErrorID::DocumentNotFound));
|
||||
let result1 = msg.response(MTTError::new(ErrorID::DocumentNotFound));
|
||||
let result2 = msg.response(Reply::new(NameType::None));
|
||||
assert_eq!(result1.get_message_id(), msg.get_message_id());
|
||||
assert_eq!(result2.get_message_id(), msg.get_message_id());
|
||||
let action1 = result1.get_action();
|
||||
match action1 {
|
||||
MsgAction::Error(err) => match err.error_id() {
|
||||
MsgAction::Error(err) => match err.get_error_ids().back().unwrap() {
|
||||
ErrorID::DocumentNotFound => {}
|
||||
_ => unreachable!("got {:?}: should have received document not found", err),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user