Skip to content

Commit fa496bb

Browse files
austinabellwillpote
authored andcommitted
BM-1481: keep error context when input/program upload fails (#1016)
This has made some debugging much more painful, fixing now before I forget
1 parent 3715a6b commit fa496bb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/boundless-market/src/client.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,28 +619,30 @@ where
619619
pub async fn upload_program(&self, program: &[u8]) -> Result<Url, ClientError>
620620
where
621621
St: StorageProvider,
622+
<St as StorageProvider>::Error: std::error::Error + Send + Sync + 'static,
622623
{
623624
Ok(self
624625
.storage_provider
625626
.as_ref()
626627
.context("Storage provider not set")?
627628
.upload_program(program)
628629
.await
629-
.map_err(|_| anyhow!("Failed to upload program"))?)
630+
.context("Failed to upload program")?)
630631
}
631632

632633
/// Upload input to the storage provider.
633634
pub async fn upload_input(&self, input: &[u8]) -> Result<Url, ClientError>
634635
where
635636
St: StorageProvider,
637+
<St as StorageProvider>::Error: std::error::Error + Send + Sync + 'static,
636638
{
637639
Ok(self
638640
.storage_provider
639641
.as_ref()
640642
.context("Storage provider not set")?
641643
.upload_input(input)
642644
.await
643-
.map_err(|_| anyhow!("Failed to upload input"))?)
645+
.context("Failed to upload input")?)
644646
}
645647

646648
/// Initial parameters that will be used to build a [ProofRequest] using the [RequestBuilder].

0 commit comments

Comments
 (0)