1use zbus::zvariant::OwnedObjectPath;
2
3#[derive(thiserror::Error, Debug)]
5pub enum Error {
6 #[error("dbus operation failed: {0}")]
8 DbusError(#[from] zbus::Error),
9
10 #[error("cannot initialize network service: {0}")]
12 ServiceInitializationFailed(String),
13
14 #[error("object not found at path: {0}")]
16 ObjectNotFound(OwnedObjectPath),
17
18 #[error("object at {object_path} is wrong type: expected {expected}, got {actual}")]
20 WrongObjectType {
21 object_path: OwnedObjectPath,
23 expected: String,
25 actual: String,
27 },
28
29 #[error("cannot create {object_type} at {object_path}")]
31 ObjectCreationFailed {
32 object_type: String,
34 object_path: OwnedObjectPath,
36 #[source]
38 source: Box<dyn std::error::Error + Send + Sync>,
39 },
40
41 #[error("cannot {operation}")]
43 OperationFailed {
44 operation: &'static str,
46 #[source]
48 source: Box<dyn std::error::Error + Send + Sync>,
49 },
50
51 #[error("cannot start monitoring: cancellation token not provided")]
53 MissingCancellationToken,
54
55 #[error("cannot parse {data_type}: {reason}")]
57 DataConversionFailed {
58 data_type: String,
60 reason: String,
62 },
63}