summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2025-01-26 23:58:47 +0100
committerJoel Klinghed <the_jk@spawned.biz>2025-01-26 23:58:47 +0100
commite1d7f40ce273a983b4f871a5ba13bbda839afe72 (patch)
tree8e6eb2a90241069022050787547c68a2e5dd2935
parent1a44800b8f8b473902c2df29e9dab2054bde4c6b (diff)
Improve error output in hooks and make sure errors and accumilated
-rw-r--r--server/src/git.rs6
-rw-r--r--server/src/git_root.rs8
2 files changed, 11 insertions, 3 deletions
diff --git a/server/src/git.rs b/server/src/git.rs
index b215750..ade66cb 100644
--- a/server/src/git.rs
+++ b/server/src/git.rs
@@ -393,8 +393,10 @@ impl RepoData {
Ok(output_utf8)
} else {
Err(Error::new(format!(
- "git command failed with exitcode: {}",
- output.status
+ "git command failed with exitcode: {}\n{:?}\n{}",
+ output.status,
+ cmd.as_std().get_args(),
+ std::str::from_utf8(output.stderr.as_slice()).unwrap_or(""),
)))
}
}
diff --git a/server/src/git_root.rs b/server/src/git_root.rs
index 8102b18..bb6e5af 100644
--- a/server/src/git_root.rs
+++ b/server/src/git_root.rs
@@ -169,7 +169,13 @@ async fn git_process_prehook(
continue;
}
- let (state, rewrite) = result?;
+ let (state, rewrite) = match result {
+ Ok(data) => data,
+ Err(e) => {
+ errors.push(e.message);
+ continue;
+ }
+ };
match state {
api_model::ReviewState::Dropped => {