From 23ceeffcfa25cab87219b663eb7908c5f7fb4b09 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Wed, 4 Dec 2024 23:40:25 -0800 Subject: [PATCH] Print update error messages --- src/main.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index fcfd047..32f8c38 100644 --- a/src/main.rs +++ b/src/main.rs @@ -264,6 +264,22 @@ async fn handle_run(conf: Config, run: Run) -> Result<()> { cache_file.0.insert(record.id, addr); 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) -> Result { #[derive(Deserialize, Debug)] #[allow(dead_code)] struct Message { - code: u16, + code: u32, message: String, }