@@ -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,11 +1222,11 @@ 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
#[ non_exhaustive]
1228
1227
pub enum Error {
1229
1228
/// A fallback error type when no variant matches
1230
- #[ snafu ( display ( "Generic {} error: {}" , store, source) ) ]
1229
+ #[ error ( "Generic {} error: {}" , store, source) ]
1231
1230
Generic {
1232
1231
/// The store this error originated from
1233
1232
store : & ' static str ,
@@ -1236,7 +1235,7 @@ pub enum Error {
1236
1235
} ,
1237
1236
1238
1237
/// Error when the object is not found at given location
1239
- #[ snafu ( display ( "Object at location {} not found: {}" , path, source) ) ]
1238
+ #[ error ( "Object at location {} not found: {}" , path, source) ]
1240
1239
NotFound {
1241
1240
/// The path to file
1242
1241
path : String ,
@@ -1245,31 +1244,30 @@ pub enum Error {
1245
1244
} ,
1246
1245
1247
1246
/// Error for invalid path
1248
- #[ snafu(
1249
- display( "Encountered object with invalid path: {}" , source) ,
1250
- context( false )
1251
- ) ]
1247
+ #[ error( "Encountered object with invalid path: {}" , source) ]
1252
1248
InvalidPath {
1253
1249
/// The wrapped error
1250
+ #[ from]
1254
1251
source : path:: Error ,
1255
1252
} ,
1256
1253
1257
1254
/// Error when `tokio::spawn` failed
1258
- #[ snafu ( display ( "Error joining spawned task: {}" , source) , context ( false ) ) ]
1255
+ #[ error ( "Error joining spawned task: {}" , source) ]
1259
1256
JoinError {
1260
1257
/// The wrapped error
1258
+ #[ from]
1261
1259
source : tokio:: task:: JoinError ,
1262
1260
} ,
1263
1261
1264
1262
/// Error when the attempted operation is not supported
1265
- #[ snafu ( display ( "Operation not supported: {}" , source) ) ]
1263
+ #[ error ( "Operation not supported: {}" , source) ]
1266
1264
NotSupported {
1267
1265
/// The wrapped error
1268
1266
source : Box < dyn std:: error:: Error + Send + Sync + ' static > ,
1269
1267
} ,
1270
1268
1271
1269
/// Error when the object already exists
1272
- #[ snafu ( display ( "Object at location {} already exists: {}" , path, source) ) ]
1270
+ #[ error ( "Object at location {} already exists: {}" , path, source) ]
1273
1271
AlreadyExists {
1274
1272
/// The path to the
1275
1273
path : String ,
@@ -1278,7 +1276,7 @@ pub enum Error {
1278
1276
} ,
1279
1277
1280
1278
/// Error when the required conditions failed for the operation
1281
- #[ snafu ( display ( "Request precondition failure for path {}: {}" , path, source) ) ]
1279
+ #[ error ( "Request precondition failure for path {}: {}" , path, source) ]
1282
1280
Precondition {
1283
1281
/// The path to the file
1284
1282
path : String ,
@@ -1287,7 +1285,7 @@ pub enum Error {
1287
1285
} ,
1288
1286
1289
1287
/// Error when the object at the location isn't modified
1290
- #[ snafu ( display ( "Object at location {} not modified: {}" , path, source) ) ]
1288
+ #[ error ( "Object at location {} not modified: {}" , path, source) ]
1291
1289
NotModified {
1292
1290
/// The path to the file
1293
1291
path : String ,
@@ -1296,16 +1294,16 @@ pub enum Error {
1296
1294
} ,
1297
1295
1298
1296
/// Error when an operation is not implemented
1299
- #[ snafu ( display ( "Operation not yet implemented." ) ) ]
1297
+ #[ error ( "Operation not yet implemented." ) ]
1300
1298
NotImplemented ,
1301
1299
1302
1300
/// Error when the used credentials don't have enough permission
1303
1301
/// to perform the requested operation
1304
- #[ snafu ( display (
1302
+ #[ error (
1305
1303
"The operation lacked the necessary privileges to complete for path {}: {}" ,
1306
1304
path,
1307
1305
source
1308
- ) ) ]
1306
+ ) ]
1309
1307
PermissionDenied {
1310
1308
/// The path to the file
1311
1309
path : String ,
@@ -1314,11 +1312,11 @@ pub enum Error {
1314
1312
} ,
1315
1313
1316
1314
/// Error when the used credentials lack valid authentication
1317
- #[ snafu ( display (
1315
+ #[ error (
1318
1316
"The operation lacked valid authentication credentials for path {}: {}" ,
1319
1317
path,
1320
1318
source
1321
- ) ) ]
1319
+ ) ]
1322
1320
Unauthenticated {
1323
1321
/// The path to the file
1324
1322
path : String ,
@@ -1327,7 +1325,7 @@ pub enum Error {
1327
1325
} ,
1328
1326
1329
1327
/// Error when a configuration key is invalid for the store used
1330
- #[ snafu ( display ( "Configuration key: '{}' is not valid for store '{}'." , key, store) ) ]
1328
+ #[ error ( "Configuration key: '{}' is not valid for store '{}'." , key, store) ]
1331
1329
UnknownConfigurationKey {
1332
1330
/// The object store used
1333
1331
store : & ' static str ,
0 commit comments