Skip to content

Commit b8ef428

Browse files
committed
factor-outbound-networking: Update runtime config parsing errors
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
1 parent b07571c commit b8ef428

File tree

1 file changed

+5
-8
lines changed
  • crates/factor-outbound-networking/src/runtime_config

1 file changed

+5
-8
lines changed

crates/factor-outbound-networking/src/runtime_config/spin.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ impl SpinRuntimeConfig {
4747
) -> anyhow::Result<Option<super::RuntimeConfig>> {
4848
let maybe_blocked_networks = self
4949
.blocked_networks_from_table(table)
50-
.context("parsing blocked_networks")?;
50+
.context("failed to parse [outbound_networking] table")?;
5151
let maybe_tls_configs = self
5252
.tls_configs_from_table(table)
53-
.context("parsing client_tls")?;
53+
.context("failed to parse [[client_tls]] table")?;
5454

5555
if maybe_blocked_networks.is_none() && maybe_tls_configs.is_none() {
5656
return Ok(None);
@@ -106,7 +106,7 @@ impl SpinRuntimeConfig {
106106
.into_iter()
107107
.map(|toml_config| self.load_tls_config(toml_config))
108108
.collect::<anyhow::Result<Vec<_>>>()
109-
.context("failed to parse TLS configs from TOML")?;
109+
.context("failed to parse TLS config")?;
110110
Ok(Some(tls_configs))
111111
}
112112

@@ -124,12 +124,9 @@ impl SpinRuntimeConfig {
124124
} = toml_config;
125125
ensure!(
126126
!component_ids.is_empty(),
127-
"[[client_tls]] 'component_ids' list may not be empty"
128-
);
129-
ensure!(
130-
!hosts.is_empty(),
131-
"[[client_tls]] 'hosts' list may not be empty"
127+
"'component_ids' list may not be empty"
132128
);
129+
ensure!(!hosts.is_empty(), "'hosts' list may not be empty");
133130

134131
let components = component_ids.into_iter().map(Into::into).collect();
135132

0 commit comments

Comments
 (0)