6
6
use snafu:: { Backtrace , Snafu } ;
7
7
use std:: path:: PathBuf ;
8
8
9
- #[ cfg( any( feature = "rusoto-native-tls" , feature = "rusoto-rustls" ) ) ]
10
- use crate :: deref:: OptionDeref ;
11
-
12
9
pub ( crate ) type Result < T > = std:: result:: Result < T , Error > ;
13
10
14
11
#[ derive( Debug , Snafu ) ]
@@ -124,14 +121,6 @@ pub(crate) enum Error {
124
121
backtrace : Backtrace ,
125
122
} ,
126
123
127
- #[ snafu( display( "{}: {}" , path. display( ) , source) ) ]
128
- Key {
129
- path : PathBuf ,
130
- #[ snafu( source( from( Error , Box :: new) ) ) ]
131
- #[ snafu( backtrace) ]
132
- source : Box < Self > ,
133
- } ,
134
-
135
124
#[ snafu( display( "Duplicate key ID: {}" , key_id) ) ]
136
125
KeyDuplicate {
137
126
key_id : String ,
@@ -150,6 +139,12 @@ pub(crate) enum Error {
150
139
backtrace : Backtrace ,
151
140
} ,
152
141
142
+ #[ snafu( display( "Unable to parse keypair: {}" , source) ) ]
143
+ KeyPairFromKeySource {
144
+ source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
145
+ backtrace : Backtrace ,
146
+ } ,
147
+
153
148
#[ snafu( display( "Unable to match any of the provided keys with root.json" ) ) ]
154
149
KeysNotFoundInRoot { backtrace : Backtrace } ,
155
150
@@ -200,28 +195,6 @@ pub(crate) enum Error {
200
195
backtrace : Backtrace ,
201
196
} ,
202
197
203
- #[ cfg( any( feature = "rusoto-native-tls" , feature = "rusoto-rustls" ) ) ]
204
- #[ snafu( display( "Error creating AWS credentials provider: {}" , source) ) ]
205
- RusotoCreds {
206
- source : rusoto_credential:: CredentialsError ,
207
- backtrace : Backtrace ,
208
- } ,
209
-
210
- #[ cfg( any( feature = "rusoto-native-tls" , feature = "rusoto-rustls" ) ) ]
211
- #[ snafu( display( "Unknown AWS region \" {}\" : {}" , region, source) ) ]
212
- RusotoRegion {
213
- region : String ,
214
- source : rusoto_core:: region:: ParseRegionError ,
215
- backtrace : Backtrace ,
216
- } ,
217
-
218
- #[ cfg( any( feature = "rusoto-native-tls" , feature = "rusoto-rustls" ) ) ]
219
- #[ snafu( display( "Error creating AWS request dispatcher: {}" , source) ) ]
220
- RusotoTls {
221
- source : rusoto_core:: request:: TlsError ,
222
- backtrace : Backtrace ,
223
- } ,
224
-
225
198
#[ snafu( display( "Failed to sign message" ) ) ]
226
199
Sign {
227
200
source : tough:: error:: Error ,
@@ -234,41 +207,6 @@ pub(crate) enum Error {
234
207
backtrace : Backtrace ,
235
208
} ,
236
209
237
- #[ cfg( any( feature = "rusoto-native-tls" , feature = "rusoto-rustls" ) ) ]
238
- #[ snafu( display(
239
- "Failed to get aws-ssm://{}{}: {}" ,
240
- profile. deref_shim( ) . unwrap_or( "" ) ,
241
- parameter_name,
242
- source,
243
- ) ) ]
244
- SsmGetParameter {
245
- profile : Option < String > ,
246
- parameter_name : String ,
247
- source : rusoto_core:: RusotoError < rusoto_ssm:: GetParameterError > ,
248
- backtrace : Backtrace ,
249
- } ,
250
-
251
- #[ cfg( any( feature = "rusoto-native-tls" , feature = "rusoto-rustls" ) ) ]
252
- #[ snafu( display(
253
- "Failed to put aws-ssm://{}{}: {}" ,
254
- profile. deref_shim( ) . unwrap_or( "" ) ,
255
- parameter_name,
256
- source,
257
- ) ) ]
258
- SsmPutParameter {
259
- profile : Option < String > ,
260
- parameter_name : String ,
261
- source : rusoto_core:: RusotoError < rusoto_ssm:: PutParameterError > ,
262
- backtrace : Backtrace ,
263
- } ,
264
-
265
- #[ cfg( any( feature = "rusoto-native-tls" , feature = "rusoto-rustls" ) ) ]
266
- #[ snafu( display( "Missing field in SSM response: {}" , field) ) ]
267
- SsmMissingField {
268
- field : & ' static str ,
269
- backtrace : Backtrace ,
270
- } ,
271
-
272
210
#[ snafu( display( "Target not found: {}" , target) ) ]
273
211
TargetNotFound {
274
212
target : String ,
@@ -309,6 +247,12 @@ pub(crate) enum Error {
309
247
backtrace : Backtrace ,
310
248
} ,
311
249
250
+ #[ snafu( display( "Failed write: {}" , source) ) ]
251
+ WriteKeySource {
252
+ source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
253
+ backtrace : Backtrace ,
254
+ } ,
255
+
312
256
#[ snafu( display( "Failed writing target data to disk: {}" , source) ) ]
313
257
WriteTarget {
314
258
source : std:: io:: Error ,
0 commit comments