@@ -38,7 +38,9 @@ impl S3ConnectionInlineOrReference {
38
38
Self :: Reference ( reference) => Ok ( client
39
39
. get :: < S3Connection > ( & reference, namespace)
40
40
. await
41
- . context ( RetrieveS3ConnectionSnafu ) ?
41
+ . context ( RetrieveS3ConnectionSnafu {
42
+ s3_connection : reference,
43
+ } ) ?
42
44
. spec ) ,
43
45
}
44
46
}
@@ -47,12 +49,12 @@ impl S3ConnectionInlineOrReference {
47
49
impl ResolvedS3Connection {
48
50
/// Build the endpoint URL from this connection
49
51
pub fn endpoint ( & self ) -> Result < Url , S3Error > {
50
- let mut url = Url :: parse ( & format ! (
52
+ let endpoint = format ! (
51
53
"http://{host}:{port}" ,
52
54
host = self . host. as_url_host( ) ,
53
55
port = self . port( )
54
- ) )
55
- . context ( ParseS3EndpointSnafu ) ?;
56
+ ) ;
57
+ let mut url = Url :: parse ( & endpoint ) . context ( ParseS3EndpointSnafu { endpoint } ) ?;
56
58
57
59
if self . tls . uses_tls ( ) {
58
60
url. set_scheme ( "https" ) . map_err ( |_| {
@@ -172,7 +174,9 @@ impl S3BucketInlineOrReference {
172
174
let bucket = client
173
175
. get :: < S3Bucket > ( & reference, namespace)
174
176
. await
175
- . context ( RetrieveS3ConnectionSnafu ) ?
177
+ . context ( RetrieveS3ConnectionSnafu {
178
+ s3_connection : reference,
179
+ } ) ?
176
180
. spec ;
177
181
Ok ( ResolvedS3Bucket {
178
182
bucket_name : bucket. bucket_name ,
0 commit comments