diff --git a/crates/pixi-build/Cargo.toml b/crates/pixi-build/Cargo.toml index 192e07f..0872f96 100644 --- a/crates/pixi-build/Cargo.toml +++ b/crates/pixi-build/Cargo.toml @@ -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 } diff --git a/crates/pixi-build/src/server.rs b/crates/pixi-build/src/server.rs index 492bd28..73deee4 100644 --- a/crates/pixi-build/src/server.rs +++ b/crates/pixi-build/src/server.rs @@ -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), } }