File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed
DynamoDbEncryption/runtimes/rust/src Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -27,16 +27,23 @@ macro_rules! modify_request {
27
27
$cfg. interceptor_state( ) . store_put( OriginalRequest ( Input :: erase( $request. clone( ) ) ) ) ;
28
28
29
29
// transform the request
30
- * $request = tokio:: task:: block_in_place( || {
31
- tokio:: runtime:: Handle :: current( ) . block_on( async {
30
+ // *$request = tokio::task::block_in_place(|| {
31
+ let result = tokio:: task:: block_in_place( || {
32
+ tokio:: runtime:: Handle :: current( ) . block_on( async {
32
33
$self. client
33
34
. $transform( )
34
35
. sdk_input( $request. clone( ) )
35
36
. send( )
36
37
. await
37
- . unwrap( ) . transformed_input. unwrap( )
38
38
} )
39
- } )
39
+ } ) ;
40
+ match result {
41
+ Ok ( x) => * $request = x. transformed_input. unwrap( ) ,
42
+ Err ( x) => {
43
+ let s = format!( "{:?}" , x) ;
44
+ return Err ( s. into( ) ) ;
45
+ }
46
+ } ;
40
47
}
41
48
} ;
42
49
}
@@ -58,17 +65,23 @@ macro_rules! modify_response {
58
65
. expect( "we know this type corresponds to the output type" ) ;
59
66
60
67
// transform the response
61
- * $response = tokio:: task:: block_in_place( || {
68
+ let result = tokio:: task:: block_in_place( || {
62
69
tokio:: runtime:: Handle :: current( ) . block_on( async {
63
70
$self. client
64
71
. $transform( )
65
72
. original_input( original. clone( ) )
66
73
. sdk_output( $response. clone( ) )
67
74
. send( )
68
75
. await
69
- . unwrap( ) . transformed_output. unwrap( )
70
76
} )
71
- } )
77
+ } ) ;
78
+ match result {
79
+ Ok ( x) => * $response = x. transformed_output. unwrap( ) ,
80
+ Err ( x) => {
81
+ let s = format!( "{:?}" , x) ;
82
+ return Err ( s. into( ) ) ;
83
+ }
84
+ } ;
72
85
}
73
86
} ;
74
87
}
You can’t perform that action at this time.
0 commit comments