Print update error messages

This commit is contained in:
Edward Shen 2024-12-04 23:40:25 -08:00
parent ae5a5b84b9
commit 23ceeffcfa
Signed by: edward
GPG key ID: 0A400FFE10097C30

View file

@ -264,6 +264,22 @@ async fn handle_run(conf: Config, run: Run) -> Result<()> {
cache_file.0.insert(record.id, addr); cache_file.0.insert(record.id, addr);
continue; continue;
} }
for message in resp.messages {
info!(
code = message.code,
message = message.message,
"Cloudflare API returned message"
);
}
for error in resp.errors {
warn!(
code = error.code,
message = error.message,
"Cloudflare API returned error"
);
}
} }
} }
@ -312,7 +328,7 @@ fn ip_cache_path(cache_dir: Option<PathBuf>) -> Result<PathBuf> {
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]
#[allow(dead_code)] #[allow(dead_code)]
struct Message { struct Message {
code: u16, code: u32,
message: String, message: String,
} }