Skip to content

Commit

Permalink
return the whole report as message
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Jan 17, 2025
1 parent 70db8ee commit 350e4c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/pixi-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fs-err = { workspace = true }
indexmap = { workspace = true }
itertools = { workspace = true }
log = { workspace = true }
miette = { workspace = true }
miette = { workspace = true, features = ["fancy-base"] }
minijinja = { workspace = true }
parking_lot = { workspace = true }
rattler_conda_types = { workspace = true }
Expand Down
5 changes: 4 additions & 1 deletion crates/pixi-build/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,13 @@ fn convert_error(err: miette::Report) -> jsonrpc_core::Error {
rendered
.render_report(&mut json_str, err.as_ref())
.expect("failed to convert error to json");

let report = format!("{:?}", err);

let data = serde_json::from_str(&json_str).expect("failed to parse json error");
jsonrpc_core::Error {
code: jsonrpc_core::ErrorCode::ServerError(-32000),
message: err.to_string(),
message: report,
data: Some(data),
}
}

0 comments on commit 350e4c9

Please sign in to comment.