diff --git a/src/errorfr/mod.rs b/src/errorfr/mod.rs index e22cd23..65848a1 100644 --- a/src/errorfr/mod.rs +++ b/src/errorfr/mod.rs @@ -42,4 +42,8 @@ pub enum Errorfr { /// unable to copy (write in) file content #[error("Error 3.4: Download successful, but unable to write to file.")] JsonDlReqFileWriteFail, + + /// Name value was not found in json + #[error("Error 3.4: \"Name\" field was not found in the json (required for Gear, Tome, Charm)")] + JsonNotFoundName } diff --git a/src/main.rs b/src/main.rs index 71d5c7d..98e41fd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -135,6 +135,9 @@ fn cook( if let Some(real_name) = json_config.name { encode_namedata(&mut fr_params, &real_name) } + else { + return Err(Errorfr::JsonNotFoundName) + } } _ => {} }