Skip to main content

appcore_transfer/
error.rs

1// =============================================================================
2//        #######
3//     ###       ###     F: error.rs
4//    ##   ## ##   ##    P: AppCore-Runtime
5//         ## ##
6//                       C: 2026/10/06 00:00:00 by dnettoRaw
7//    ##   ## ##   ##    U: 2026/10/06 00:00:00 by dnettoRaw
8//      ###########      S: 0.1.0-beta.1
9// =============================================================================
10
11//! Controlled errors without payloads, credentials or unbounded provider messages.
12/// Controlled transfer failure.
13#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
14#[non_exhaustive]
15pub enum TransferError {
16    /// Policy or descriptor is malformed.
17    #[error("invalid transfer contract")]
18    InvalidContract,
19    /// Unknown serialized format version.
20    #[error("NO MORE SUPPORTED PLEASE UPDATE")]
21    UnsupportedVersion,
22    /// A resource budget would be exceeded.
23    #[error("transfer resource limit exceeded")]
24    Limit,
25    /// Untrusted path, symlink or filesystem permissions.
26    #[error("unsafe transfer path")]
27    UnsafePath,
28    /// Another process/session holds the store lock.
29    #[error("transfer store busy")]
30    Busy,
31    /// Persistent data or received block failed integrity validation.
32    #[error("transfer integrity mismatch")]
33    Integrity,
34    /// Filesystem operation failed; resumable progress may already be durable.
35    #[error("transfer storage failure")]
36    Storage,
37    /// No authorized, usable source remains or bounded retries were exhausted.
38    #[error("transfer sources exhausted")]
39    SourcesExhausted,
40    /// Cooperative cancellation requested.
41    #[error("transfer cancelled")]
42    Cancelled,
43    /// Monotonic deadline expired.
44    #[error("transfer deadline expired")]
45    Deadline,
46    /// Selected provider failed or panicked.
47    #[error("transfer source failure")]
48    Source,
49}
50/// Result from bounded transfer operations.
51pub type TransferResult<T> = Result<T, TransferError>;