Prevent overwriting existing documents.

This commit is contained in:
2025-05-03 08:40:51 -04:00
parent ea825c89eb
commit e7c7d9f270
4 changed files with 87 additions and 9 deletions

View File

@ -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"),
}