Skip to content

Commit

Permalink
Improve failure message from dapf
Browse files Browse the repository at this point in the history
  • Loading branch information
mendess committed Dec 19, 2024
1 parent fccce9a commit a717a8f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions crates/dapf/src/functions/test_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//!
//! [interop]: https://divergentdave.github.io/draft-dcook-ppm-dap-interop-test-design/draft-dcook-ppm-dap-interop-test-design.html
use anyhow::Context;
use anyhow::{bail, Context};
use daphne::{
hpke::{HpkeKemId, HpkeReceiverConfig},
messages::HpkeConfigList,
Expand Down Expand Up @@ -53,12 +53,18 @@ impl HttpClient {
}

pub async fn delete_all_storage(&self, aggregator_url: &Url) -> anyhow::Result<()> {
self.post(aggregator_url.join("/internal/delete_all").unwrap())
let resp = self
.post(aggregator_url.join("/internal/delete_all").unwrap())
.send()
.await
.context("deleting storage")?
.error_for_status()
.context("deleting storage")?;
Ok(())
if resp.status().is_success() {
return Ok(());
}
bail!(
"delete storage request failed. {} {}",
resp.status(),
resp.text().await?
);
}
}

0 comments on commit a717a8f

Please sign in to comment.