posemesh_compute_node/
errors.rs

1use thiserror::Error;
2
3/// Errors originating from DMS client operations.
4#[derive(Debug, Error)]
5pub enum DmsClientError {
6    #[error("unauthorized (401)")]
7    Unauthorized,
8    #[error("request timed out")]
9    Timeout,
10    #[error("http error: {0}")]
11    Http(String),
12    #[error("transport error: {0}")]
13    Transport(String),
14}
15
16/// Errors during task execution orchestration.
17#[derive(Debug, Error)]
18pub enum ExecutorError {
19    #[error("no runner registered for capability: {0}")]
20    NoRunner(String),
21    #[error("runner failed: {0}")]
22    Runner(String),
23}
24
25/// Errors in token management / rotation.
26#[derive(Debug, Error)]
27pub enum TokenManagerError {
28    #[error("token rotation failed: {0}")]
29    Rotation(String),
30}
31
32/// Storage client error mapping (see SPECS ยง9 Errors).
33#[derive(Debug, Error)]
34pub enum StorageError {
35    #[error("bad request (400)")]
36    BadRequest,
37    #[error("unauthorized (401)")]
38    Unauthorized,
39    #[error("not found (404)")]
40    NotFound,
41    #[error("conflict (409)")]
42    Conflict,
43    #[error("server error ({0})")]
44    Server(u16),
45    #[error("network error: {0}")]
46    Network(String),
47    #[error("other storage error: {0}")]
48    Other(String),
49}