Skip to main content

sonos_sdk/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4#[non_exhaustive]
5pub enum SdkError {
6    #[error("state management error: {0}")]
7    StateError(#[from] sonos_state::StateError),
8
9    #[error("api error: {0}")]
10    ApiError(#[from] sonos_api::ApiError),
11
12    #[error("event manager error: {0}")]
13    EventManager(String),
14
15    #[error("speaker not found: {0}")]
16    SpeakerNotFound(String),
17
18    #[error("invalid ip address")]
19    InvalidIpAddress,
20
21    #[error("property watcher closed")]
22    WatcherClosed,
23
24    #[error("property fetch failed: {0}")]
25    FetchFailed(String),
26
27    #[error("validation failed: {0}")]
28    ValidationFailed(#[from] sonos_api::operation::ValidationError),
29
30    #[error("invalid operation: {0}")]
31    InvalidOperation(String),
32
33    #[error("discovery failed: {0}")]
34    DiscoveryFailed(String),
35
36    #[error("internal lock poisoned")]
37    LockPoisoned,
38}