66use snafu:: { Backtrace , Snafu } ;
77use std:: path:: PathBuf ;
88
9- #[ cfg( any( feature = "rusoto-native-tls" , feature = "rusoto-rustls" ) ) ]
10- use crate :: deref:: OptionDeref ;
11-
129pub ( crate ) type Result < T > = std:: result:: Result < T , Error > ;
1310
1411#[ derive( Debug , Snafu ) ]
@@ -124,14 +121,6 @@ pub(crate) enum Error {
124121 backtrace : Backtrace ,
125122 } ,
126123
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-
135124 #[ snafu( display( "Duplicate key ID: {}" , key_id) ) ]
136125 KeyDuplicate {
137126 key_id : String ,
@@ -150,6 +139,12 @@ pub(crate) enum Error {
150139 backtrace : Backtrace ,
151140 } ,
152141
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+
153148 #[ snafu( display( "Unable to match any of the provided keys with root.json" ) ) ]
154149 KeysNotFoundInRoot { backtrace : Backtrace } ,
155150
@@ -200,28 +195,6 @@ pub(crate) enum Error {
200195 backtrace : Backtrace ,
201196 } ,
202197
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-
225198 #[ snafu( display( "Failed to sign message" ) ) ]
226199 Sign {
227200 source : tough:: error:: Error ,
@@ -234,41 +207,6 @@ pub(crate) enum Error {
234207 backtrace : Backtrace ,
235208 } ,
236209
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-
272210 #[ snafu( display( "Target not found: {}" , target) ) ]
273211 TargetNotFound {
274212 target : String ,
@@ -309,6 +247,12 @@ pub(crate) enum Error {
309247 backtrace : Backtrace ,
310248 } ,
311249
250+ #[ snafu( display( "Failed write: {}" , source) ) ]
251+ WriteKeySource {
252+ source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
253+ backtrace : Backtrace ,
254+ } ,
255+
312256 #[ snafu( display( "Failed writing target data to disk: {}" , source) ) ]
313257 WriteTarget {
314258 source : std:: io:: Error ,
0 commit comments