firecloud-storage 0.2.0

Chunking, compression, and local storage for FireCloud distributed storage
Documentation
//! Storage error types

use thiserror::Error;

#[derive(Error, Debug)]
pub enum StorageError {
    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),

    #[error("Database error: {0}")]
    Database(String),

    #[error("Chunk not found: {0}")]
    ChunkNotFound(String),

    #[error("Manifest not found: {0}")]
    ManifestNotFound(String),

    #[error("Invalid ID: {0}")]
    InvalidId(String),

    #[error("Compression error: {0}")]
    Compression(String),

    #[error("Decompression error: {0}")]
    Decompression(String),

    #[error("Serialization error: {0}")]
    Serialization(String),

    #[error("Invalid data: {0}")]
    InvalidData(String),

    #[error("Storage quota exceeded: requested {requested} bytes, only {available} available")]
    QuotaExceeded { requested: u64, available: u64 },

    #[error("Quota limit not set")]
    QuotaNotSet,
}

pub type StorageResult<T> = Result<T, StorageError>;