Skip to content

Commit 5c90e2b

Browse files
leftwoAlan Hanson
andauthored
Include the error chain if sled add fails (#7840)
Fixes #7835 Co-authored-by: Alan Hanson <alan@oxide.computer>
1 parent 2f5cf05 commit 5c90e2b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

nexus/src/app/rack.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -926,13 +926,14 @@ impl super::Nexus {
926926
reqwest_client,
927927
self.log.new(o!("sled_agent_url" => sa_url.clone())),
928928
);
929-
sa.sled_add(&req).await.map_err(|e| Error::InternalError {
930-
internal_message: format!(
931-
"failed to add sled with baseboard {:?} to rack {}: {e}",
932-
sled, allocation.rack_id
933-
),
929+
sa.sled_add(&req).await.map_err(|e| {
930+
Error::internal_error(&format!(
931+
"failed to add sled with baseboard {:?} to rack {}: {}",
932+
sled,
933+
allocation.rack_id,
934+
InlineErrorChain::new(&e)
935+
))
934936
})?;
935-
936937
Ok(allocation.sled_id.into())
937938
}
938939

0 commit comments

Comments
 (0)