Skip to content

Commit e75fe7f

Browse files
committed
add todo comments and change more bails to unreachables
Signed-off-by: Joel Dice <[email protected]>
1 parent 6822583 commit e75fe7f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

crates/factor-outbound-http/src/wasi.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ fn dns_error(rcode: String, info_code: u16) -> ErrorCode {
728728
})
729729
}
730730

731+
// TODO: Remove this (and uses of it) once
732+
// https://github.com/spinframework/spin/issues/3274 has been addressed.
731733
pub fn p2_to_p3_error_code(code: p2_types::ErrorCode) -> p3_types::ErrorCode {
732734
match code {
733735
p2_types::ErrorCode::DnsTimeout => p3_types::ErrorCode::DnsTimeout,
@@ -828,6 +830,8 @@ pub fn p2_to_p3_error_code(code: p2_types::ErrorCode) -> p3_types::ErrorCode {
828830
}
829831
}
830832

833+
// TODO: Remove this (and uses of it) once
834+
// https://github.com/spinframework/spin/issues/3274 has been addressed.
831835
pub fn p3_to_p2_error_code(code: p3_types::ErrorCode) -> p2_types::ErrorCode {
832836
match code {
833837
p3_types::ErrorCode::DnsTimeout => p2_types::ErrorCode::DnsTimeout,

crates/trigger-http/src/spin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl HttpExecutor for SpinHttpExecutor {
3030
) -> Result<Response<Body>> {
3131
let spin_http::routes::TriggerLookupKey::Component(component_id) = route_match.lookup_key()
3232
else {
33-
anyhow::bail!("INCONCEIVABLE");
33+
unreachable!()
3434
};
3535

3636
tracing::trace!("Executing request using the Spin executor for component {component_id}");

crates/trigger-http/src/wagi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl HttpExecutor for WagiHttpExecutor<'_> {
2929
) -> Result<Response<Body>> {
3030
let spin_http::routes::TriggerLookupKey::Component(component) = route_match.lookup_key()
3131
else {
32-
anyhow::bail!("INCONCEIVABLE");
32+
unreachable!()
3333
};
3434

3535
tracing::trace!(

0 commit comments

Comments
 (0)