From dd5d946d75682436e4301158406cf2df1487e9c0 Mon Sep 17 00:00:00 2001 From: konstin Date: Mon, 15 Apr 2024 11:01:54 +0200 Subject: [PATCH] Indent error messages --- crates/uv-build/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/uv-build/src/lib.rs b/crates/uv-build/src/lib.rs index 4cf7bc04b..d2309347a 100644 --- a/crates/uv-build/src/lib.rs +++ b/crates/uv-build/src/lib.rs @@ -81,7 +81,7 @@ pub enum Error { Virtualenv(#[from] uv_virtualenv::Error), #[error("Failed to run {0}")] CommandFailed(PathBuf, #[source] io::Error), - #[error("{message} with {exit_code}\n--- stdout:\n{stdout}\n--- stderr:\n{stderr}\n---")] + #[error("{message} with {exit_code}\nstdout:\n{stdout}\nstderr:\n{stderr}\n")] BuildBackend { message: String, exit_code: ExitStatus, @@ -89,7 +89,7 @@ pub enum Error { stderr: String, }, /// Nudge the user towards installing the missing dev library - #[error("{message} with {exit_code}\n--- stdout:\n{stdout}\n--- stderr:\n{stderr}\n---")] + #[error("{message} with {exit_code}\nstdout:\n{stdout}\nstderr:\n{stderr}\n")] MissingHeader { message: String, exit_code: ExitStatus, @@ -183,6 +183,9 @@ impl Error { }; } + let stdout = stdout.lines().map(|line| format!(" | {line}")).join("\n"); + let stderr = stderr.lines().map(|line| format!(" | {line}")).join("\n"); + Self::BuildBackend { message, exit_code: output.status,