From 19220178311ca80374f6f5ff4069c0adcaab932d Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 5 Jan 2023 11:27:18 +0100 Subject: Properly handle empty node catalog --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 75091e1..8a9ad53 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -146,7 +146,7 @@ impl Consul { &self, host: &str, idx: Option, - ) -> Result<(ConsulNodeCatalog, usize)> { + ) -> Result<(Option, usize)> { debug!("watch_node {} {:?}", host, idx); let url = match idx { @@ -160,7 +160,7 @@ impl Consul { None => bail!("X-Consul-Index header not found"), }; - let resp: ConsulNodeCatalog = http.json().await?; + let resp: Option = http.json().await?; Ok((resp, new_idx)) } -- cgit v1.2.3