wasmio 0.0.13

WasmIO a S3 Implementation on steroid
Documentation
use tracing::warn;

use crate::infrastructure::storage::FSError;

#[derive(Clone, Debug, thiserror::Error)]
pub enum BucketStorageError {
    #[error("An issue happened")]
    Unknown,
    #[error("Database already exist")]
    DatabaseAlreadyExist,
    #[error("No bucket")]
    NoBucket,
    #[error("No key")]
    NoKey,
}

impl From<FSError> for BucketStorageError {
    fn from(value: FSError) -> Self {
        warn!("{value:?}");
        match value {
            FSError::AlreadyExist => Self::DatabaseAlreadyExist,
            FSError::NoDatabase => Self::NoBucket,
            _ => Self::Unknown,
        }
    }
}