Prevent overwriting existing documents.
This commit is contained in:
@ -22,6 +22,7 @@ pub enum ActionType {
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum ErrorType {
|
||||
DocumentAlreadyExists,
|
||||
DocumentNotFound,
|
||||
}
|
||||
|
||||
@ -74,7 +75,8 @@ mod mtt_replies {
|
||||
let reply = MTTReply::new(msg);
|
||||
match reply.get_error() {
|
||||
Some(err) => match err {
|
||||
ErrorType::DocumentNotFound => {}
|
||||
ErrorType::DocumentNotFound => {},
|
||||
_ => unreachable!("got {:?}: should have been document not found", err),
|
||||
},
|
||||
None => unreachable!("should return an error type"),
|
||||
}
|
||||
@ -96,6 +98,7 @@ mod mtt_replies {
|
||||
match reply.get_error() {
|
||||
Some(err) => match err {
|
||||
ErrorType::DocumentNotFound => {}
|
||||
_ => unreachable!("got {:?}: should have been document not found", err),
|
||||
},
|
||||
None => unreachable!("should return an error type"),
|
||||
}
|
||||
|
Reference in New Issue
Block a user