Handle bad json.

This commit is contained in:
2025-05-03 09:48:53 -04:00
parent e7c7d9f270
commit 80124af836
4 changed files with 65 additions and 7 deletions

View File

@ -23,6 +23,7 @@ pub enum ActionType {
#[derive(Clone, Debug)]
pub enum ErrorType {
DocumentAlreadyExists,
DocumentInvalidRequest,
DocumentNotFound,
}
@ -75,7 +76,7 @@ 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"),