diff --git a/crates/controlplane/src/server/actions/config.rs b/crates/controlplane/src/server/actions/config.rs index 47528705..bb7bfc6d 100644 --- a/crates/controlplane/src/server/actions/config.rs +++ b/crates/controlplane/src/server/actions/config.rs @@ -14,7 +14,7 @@ use crate::{ env::PortType, server::error::ServerError, state::{pending_reconcile_node_map, PendingAgentReconcile}, - unwrap_or_bad_request, + unwrap_or_not_found, }; pub async fn config( @@ -56,7 +56,7 @@ pub async fn config( for WithTargets { nodes, data } in configs { let binary = if let Some(b) = data.binary.as_ref() { - Some(unwrap_or_bad_request!("invalid binary id", id_or_none(b))) + Some(unwrap_or_not_found!("unknown binary id", id_or_none(b))) } else { None }; diff --git a/crates/controlplane/src/server/actions/deploy.rs b/crates/controlplane/src/server/actions/deploy.rs index d29d1bf3..97067447 100644 --- a/crates/controlplane/src/server/actions/deploy.rs +++ b/crates/controlplane/src/server/actions/deploy.rs @@ -18,7 +18,7 @@ use crate::{ env::{error::ExecutionError, Environment}, server::error::ServerError, state::GlobalState, - unwrap_or_bad_request, + unwrap_or_not_found, }; pub async fn deploy( @@ -27,7 +27,7 @@ pub async fn deploy( Query(query): Query, Json(action): Json, ) -> Response { - let cannon_id = unwrap_or_bad_request!("invalid cannon id", id_or_none(&action.cannon)); + let cannon_id = unwrap_or_not_found!("unknown cannon id", id_or_none(&action.cannon)); let query_addr = env.cannons.get(&cannon_id).map(|c| c.get_local_query()); if query.is_async() { diff --git a/crates/controlplane/src/server/content.rs b/crates/controlplane/src/server/content.rs index fe2b8e6b..5c4699f0 100644 --- a/crates/controlplane/src/server/content.rs +++ b/crates/controlplane/src/server/content.rs @@ -79,8 +79,8 @@ async fn serve_binary( State(state): State, req: Request, ) -> Response { - let storage_id = unwrap_or_bad_request!("invalid storage id", id_or_none(&storage_id)); - let binary_id = unwrap_or_bad_request!("invalid binary id", id_or_none(&binary_id)); + let storage_id = unwrap_or_not_found!("unknown storage id", id_or_none(&storage_id)); + let binary_id = unwrap_or_not_found!("unknown binary id", id_or_none(&binary_id)); let storage = unwrap_or_not_found!( "storage not found",