Skip to content

Commit

Permalink
fix(ic-boundary): add error cause to extensions (#2692)
Browse files Browse the repository at this point in the history
  • Loading branch information
r-birkner authored Nov 21, 2024
1 parent 0dc55e0 commit 72e16a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rs/boundary_node/ic_boundary/src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ impl ErrorCause {
impl IntoResponse for ErrorCause {
fn into_response(self) -> Response {
let client_facing_error = self.to_client_facing_error();
client_facing_error.into_response()
let mut resp = client_facing_error.into_response();
resp.extensions_mut().insert(self);
resp
}
}

Expand Down Expand Up @@ -224,9 +226,7 @@ impl IntoResponse for ErrorClientFacing {
let headers = [(X_IC_ERROR_CAUSE, error_cause.clone())];
let body = format!("error: {}\ndetails: {}", error_cause, self.details());

let mut resp = (self.status_code(), headers, body).into_response();
resp.extensions_mut().insert(self);
resp
(self.status_code(), headers, body).into_response()
}
}

Expand Down

0 comments on commit 72e16a6

Please sign in to comment.