diff options
author | Alex Auvolat <alex@adnab.me> | 2023-01-05 11:27:18 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-01-05 11:27:18 +0100 |
commit | 19220178311ca80374f6f5ff4069c0adcaab932d (patch) | |
tree | 0c93f733cda141a39474f79b69d4658523cf5278 /src | |
parent | b0af49c24c0f8e006e02704d398318cf74ae1d6f (diff) | |
download | df-consul-19220178311ca80374f6f5ff4069c0adcaab932d.tar.gz df-consul-19220178311ca80374f6f5ff4069c0adcaab932d.zip |
Properly handle empty node catalog
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -146,7 +146,7 @@ impl Consul { &self, host: &str, idx: Option<usize>, - ) -> Result<(ConsulNodeCatalog, usize)> { + ) -> Result<(Option<ConsulNodeCatalog>, 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<ConsulNodeCatalog> = http.json().await?; Ok((resp, new_idx)) } |