Skip to main content

firecloud_core/
error.rs

1//! Error types for FireCloud
2
3use thiserror::Error;
4
5/// Main error type for FireCloud operations
6#[derive(Error, Debug)]
7pub enum Error {
8    #[error("IO error: {0}")]
9    Io(#[from] std::io::Error),
10
11    #[error("Serialization error: {0}")]
12    Serialization(String),
13
14    #[error("Chunk not found: {0}")]
15    ChunkNotFound(String),
16
17    #[error("File not found: {0}")]
18    FileNotFound(String),
19
20    #[error("Encryption error: {0}")]
21    Encryption(String),
22
23    #[error("Decryption error: {0}")]
24    Decryption(String),
25
26    #[error("Network error: {0}")]
27    Network(String),
28
29    #[error("Storage error: {0}")]
30    Storage(String),
31
32    #[error("Invalid data: {0}")]
33    InvalidData(String),
34
35    #[error("Erasure coding error: {0}")]
36    ErasureCoding(String),
37
38    #[error("{0}")]
39    Other(String),
40}
41
42/// Result type alias for FireCloud operations
43pub type Result<T> = std::result::Result<T, Error>;