@@ -562,7 +562,6 @@ use async_trait::async_trait;
562
562
use bytes:: Bytes ;
563
563
use chrono:: { DateTime , Utc } ;
564
564
use futures:: { stream:: BoxStream , StreamExt , TryStreamExt } ;
565
- use snafu:: Snafu ;
566
565
use std:: fmt:: { Debug , Formatter } ;
567
566
#[ cfg( not( target_arch = "wasm32" ) ) ]
568
567
use std:: io:: { Read , Seek , SeekFrom } ;
@@ -1223,78 +1222,81 @@ pub struct PutResult {
1223
1222
pub type Result < T , E = Error > = std:: result:: Result < T , E > ;
1224
1223
1225
1224
/// A specialized `Error` for object store-related errors
1226
- #[ derive( Debug , Snafu ) ]
1225
+ #[ derive( Debug , thiserror :: Error ) ]
1227
1226
#[ allow( missing_docs) ]
1228
1227
#[ non_exhaustive]
1229
1228
pub enum Error {
1230
- #[ snafu ( display ( "Generic {} error: {}" , store, source) ) ]
1229
+ #[ error ( "Generic {} error: {}" , store, source) ]
1231
1230
Generic {
1232
1231
store : & ' static str ,
1233
1232
source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
1234
1233
} ,
1235
1234
1236
- #[ snafu ( display ( "Object at location {} not found: {}" , path, source) ) ]
1235
+ #[ error ( "Object at location {} not found: {}" , path, source) ]
1237
1236
NotFound {
1238
1237
path : String ,
1239
1238
source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
1240
1239
} ,
1241
1240
1242
- #[ snafu (
1243
- display ( "Encountered object with invalid path: {}" , source ) ,
1244
- context ( false )
1245
- ) ]
1246
- InvalidPath { source : path :: Error } ,
1241
+ #[ error ( "Encountered object with invalid path: {}" , source ) ]
1242
+ InvalidPath {
1243
+ # [ from ]
1244
+ source : path :: Error ,
1245
+ } ,
1247
1246
1248
- #[ snafu( display( "Error joining spawned task: {}" , source) , context( false ) ) ]
1249
- JoinError { source : tokio:: task:: JoinError } ,
1247
+ #[ error( "Error joining spawned task: {}" , source) ]
1248
+ JoinError {
1249
+ #[ from]
1250
+ source : tokio:: task:: JoinError ,
1251
+ } ,
1250
1252
1251
- #[ snafu ( display ( "Operation not supported: {}" , source) ) ]
1253
+ #[ error ( "Operation not supported: {}" , source) ]
1252
1254
NotSupported {
1253
1255
source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
1254
1256
} ,
1255
1257
1256
- #[ snafu ( display ( "Object at location {} already exists: {}" , path, source) ) ]
1258
+ #[ error ( "Object at location {} already exists: {}" , path, source) ]
1257
1259
AlreadyExists {
1258
1260
path : String ,
1259
1261
source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
1260
1262
} ,
1261
1263
1262
- #[ snafu ( display ( "Request precondition failure for path {}: {}" , path, source) ) ]
1264
+ #[ error ( "Request precondition failure for path {}: {}" , path, source) ]
1263
1265
Precondition {
1264
1266
path : String ,
1265
1267
source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
1266
1268
} ,
1267
1269
1268
- #[ snafu ( display ( "Object at location {} not modified: {}" , path, source) ) ]
1270
+ #[ error ( "Object at location {} not modified: {}" , path, source) ]
1269
1271
NotModified {
1270
1272
path : String ,
1271
1273
source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
1272
1274
} ,
1273
1275
1274
- #[ snafu ( display ( "Operation not yet implemented." ) ) ]
1276
+ #[ error ( "Operation not yet implemented." ) ]
1275
1277
NotImplemented ,
1276
1278
1277
- #[ snafu ( display (
1279
+ #[ error (
1278
1280
"The operation lacked the necessary privileges to complete for path {}: {}" ,
1279
1281
path,
1280
1282
source
1281
- ) ) ]
1283
+ ) ]
1282
1284
PermissionDenied {
1283
1285
path : String ,
1284
1286
source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
1285
1287
} ,
1286
1288
1287
- #[ snafu ( display (
1289
+ #[ error (
1288
1290
"The operation lacked valid authentication credentials for path {}: {}" ,
1289
1291
path,
1290
1292
source
1291
- ) ) ]
1293
+ ) ]
1292
1294
Unauthenticated {
1293
1295
path : String ,
1294
1296
source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
1295
1297
} ,
1296
1298
1297
- #[ snafu ( display ( "Configuration key: '{}' is not valid for store '{}'." , key, store) ) ]
1299
+ #[ error ( "Configuration key: '{}' is not valid for store '{}'." , key, store) ]
1298
1300
UnknownConfigurationKey { store : & ' static str , key : String } ,
1299
1301
}
1300
1302
0 commit comments