Skip to content

Commit

Permalink
apple-codesign: print S3 error context
Browse files Browse the repository at this point in the history
To help diagnose issues reported in #144.
  • Loading branch information
indygreg committed Nov 3, 2024
1 parent b7fab9b commit 0e88caf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions apple-codesign/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Released on ReleaseDate.
* Fixed `env_logger` construction so `RUST_LOG` environment variable is
respected. (#162)
* MSRV 1.70 -> 1.78.
* Improve logging of S3 upload failures. We should now hopefully print something
more useful than `s3 upload error: unhandled error` on failures.
* `aws-config` 1.1 -> 1.5.
* `aws-sdk-s3` 1.12 -> 1.24.
* `aws-smithy-types` 1.1 -> 1.2.
Expand Down
6 changes: 5 additions & 1 deletion apple-codesign/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,11 @@ pub enum AppleCodesignError {

#[cfg(feature = "notarize")]
#[error("s3 upload error: {0}")]
AwsS3Error(Box<aws_sdk_s3::Error>),
AwsS3PutObject(
aws_smithy_types::error::display::DisplayErrorContext<
aws_sdk_s3::error::SdkError<aws_sdk_s3::operation::put_object::PutObjectError>,
>,
),

#[error("bad time value")]
BadTime,
Expand Down
7 changes: 5 additions & 2 deletions apple-codesign/src/notarization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,11 @@ impl Notarizer {
.body(bytestream)
.send();

rt.block_on(fut)
.map_err(|e| AppleCodesignError::AwsS3Error(Box::new(aws_sdk_s3::Error::from(e))))?;
rt.block_on(fut).map_err(|e| {
AppleCodesignError::AwsS3PutObject(
aws_smithy_types::error::display::DisplayErrorContext(e),
)
})?;

warn!("S3 upload completed successfully");

Expand Down

0 comments on commit 0e88caf

Please sign in to comment.