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