1
0
Fork 0

print whole error chain

This commit is contained in:
Cyborus 2023-11-30 15:21:28 -05:00
parent f05936cbd1
commit 19effc86d0
No known key found for this signature in database

View file

@ -13,9 +13,11 @@ async fn ci() -> eyre::Result<()> {
results.push(repo(&api).await.wrap_err("repo error")); results.push(repo(&api).await.wrap_err("repo error"));
let mut errors = 0; let mut errors = 0;
for res in results.into_iter().filter_map(Result::err) { for report in results.into_iter().filter_map(Result::err) {
errors += 1; errors += 1;
println!("{res}"); for (i, err) in report.chain().enumerate() {
println!("{i}. {err}");
}
} }
if errors > 0 { if errors > 0 {
eyre::bail!("test failed"); eyre::bail!("test failed");
@ -83,7 +85,7 @@ async fn repo(api: &forgejo_api::Forgejo) -> eyre::Result<()> {
let mut push_options = git2::PushOptions::new(); let mut push_options = git2::PushOptions::new();
push_options.remote_callbacks(callbacks); push_options.remote_callbacks(callbacks);
let mut origin = local_repo.remote("origin", remote_repo.clone_url.as_str())?; let mut origin = local_repo.remote("origin", remote_repo.clone_url.as_str())?;
origin.push(&[branch_ref_name], Some(&mut push_options))?; origin.push(&[dbg!(branch_ref_name)], Some(&mut push_options))?;
tokio::fs::write("/test_repo/example.rs", "fn add_one(x: u32) -> u32 { x + 1 }").await?; tokio::fs::write("/test_repo/example.rs", "fn add_one(x: u32) -> u32 { x + 1 }").await?;
let mut index = local_repo.index()?; let mut index = local_repo.index()?;
@ -102,7 +104,7 @@ async fn repo(api: &forgejo_api::Forgejo) -> eyre::Result<()> {
}); });
let mut push_options = git2::PushOptions::new(); let mut push_options = git2::PushOptions::new();
push_options.remote_callbacks(callbacks); push_options.remote_callbacks(callbacks);
origin.push(&[branch_ref_name], Some(&mut push_options)).wrap_err("failed to push branch")?; origin.push(&[dbg!(branch_ref_name)], Some(&mut push_options)).wrap_err("failed to push branch")?;
let pr_opt = forgejo_api::CreatePullRequestOption { let pr_opt = forgejo_api::CreatePullRequestOption {
assignee: None, assignee: None,