@@ -1224,78 +1224,116 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
12241224
12251225/// A specialized `Error` for object store-related errors
12261226#[ derive( Debug , Snafu ) ]
1227- #[ allow( missing_docs) ]
12281227#[ non_exhaustive]
12291228pub enum Error {
1229+ /// A fallback error type when no variant matches
12301230 #[ snafu( display( "Generic {} error: {}" , store, source) ) ]
12311231 Generic {
1232+ /// The store this error originated from
12321233 store : & ' static str ,
1234+ /// The wrapped error
12331235 source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
12341236 } ,
12351237
1238+ /// Error when the object is not found at given location
12361239 #[ snafu( display( "Object at location {} not found: {}" , path, source) ) ]
12371240 NotFound {
1241+ /// The path to file
12381242 path : String ,
1243+ /// The wrapped error
12391244 source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
12401245 } ,
12411246
1247+ /// Error for invalid path
12421248 #[ snafu(
12431249 display( "Encountered object with invalid path: {}" , source) ,
12441250 context( false )
12451251 ) ]
1246- InvalidPath { source : path:: Error } ,
1252+ InvalidPath {
1253+ /// The wrapped error
1254+ source : path:: Error ,
1255+ } ,
12471256
1257+ /// Error when `tokio::spawn` failed
12481258 #[ snafu( display( "Error joining spawned task: {}" , source) , context( false ) ) ]
1249- JoinError { source : tokio:: task:: JoinError } ,
1259+ JoinError {
1260+ /// The wrapped error
1261+ source : tokio:: task:: JoinError ,
1262+ } ,
12501263
1264+ /// Error when the attempted operation is not supported
12511265 #[ snafu( display( "Operation not supported: {}" , source) ) ]
12521266 NotSupported {
1267+ /// The wrapped error
12531268 source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
12541269 } ,
12551270
1271+ /// Error when the object already exists
12561272 #[ snafu( display( "Object at location {} already exists: {}" , path, source) ) ]
12571273 AlreadyExists {
1274+ /// The path to the
12581275 path : String ,
1276+ /// The wrapped error
12591277 source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
12601278 } ,
12611279
1280+ /// Error when the required conditions failed for the operation
12621281 #[ snafu( display( "Request precondition failure for path {}: {}" , path, source) ) ]
12631282 Precondition {
1283+ /// The path to the file
12641284 path : String ,
1285+ /// The wrapped error
12651286 source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
12661287 } ,
12671288
1289+ /// Error when the object at the location isn't modified
12681290 #[ snafu( display( "Object at location {} not modified: {}" , path, source) ) ]
12691291 NotModified {
1292+ /// The path to the file
12701293 path : String ,
1294+ /// The wrapped error
12711295 source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
12721296 } ,
12731297
1298+ /// Error when an operation is not implemented
12741299 #[ snafu( display( "Operation not yet implemented." ) ) ]
12751300 NotImplemented ,
12761301
1302+ /// Error when the used credentials don't have enough permission
1303+ /// to perform the requested operation
12771304 #[ snafu( display(
12781305 "The operation lacked the necessary privileges to complete for path {}: {}" ,
12791306 path,
12801307 source
12811308 ) ) ]
12821309 PermissionDenied {
1310+ /// The path to the file
12831311 path : String ,
1312+ /// The wrapped error
12841313 source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
12851314 } ,
12861315
1316+ /// Error when the used credentials lack valid authentication
12871317 #[ snafu( display(
12881318 "The operation lacked valid authentication credentials for path {}: {}" ,
12891319 path,
12901320 source
12911321 ) ) ]
12921322 Unauthenticated {
1323+ /// The path to the file
12931324 path : String ,
1325+ /// The wrapped error
12941326 source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
12951327 } ,
12961328
1329+ /// Error when a configuration key is invalid for the store used
12971330 #[ snafu( display( "Configuration key: '{}' is not valid for store '{}'." , key, store) ) ]
1298- UnknownConfigurationKey { store : & ' static str , key : String } ,
1331+ UnknownConfigurationKey {
1332+ /// The object store used
1333+ store : & ' static str ,
1334+ /// The configuration key used
1335+ key : String ,
1336+ } ,
12991337}
13001338
13011339impl From < Error > for std:: io:: Error {
0 commit comments