Skip to content

Commit

Permalink
Externally visible error for add sled fail
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjstone committed Nov 6, 2023
1 parent 0d50df0 commit 6552bb8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sled-agent/src/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,13 @@ async fn add_sled_to_initialized_rack(
)
.await
.map_err(|e| {
HttpError::for_internal_error(format!(
"failed to add sled to rack cluster: {e}"
))
let message = format!("Failed to add sled to rack cluster: {e}");
HttpError {
status_code: http::StatusCode::SERVICE_UNAVAILABLE,
error_code: None,
external_message: message.clone(),
internal_message: message,
}
})?;
Ok(HttpResponseUpdatedNoContent())
}

0 comments on commit 6552bb8

Please sign in to comment.