1use std::io;
2
3use crate::wire::{DecodeError, ObjectId};
4
5#[derive(thiserror::Error, Debug)]
6pub enum Error {
7 #[error("Failed to decode message: {0}")]
8 Decode(#[from] DecodeError),
9 #[error("I/O operation failed: {0}")]
10 IoError(#[from] io::Error),
11 #[error("Received unsupported opcode: {0}")]
12 UnknownOpcode(u16),
13 #[error("No object found with ID: {0}")]
14 MissingObject(ObjectId),
15 #[error("Failed to access XDG socket path")]
16 XdgError,
17 #[error("{0}")]
18 Custom(String),
19}
20
21pub type Result<T, E = Error> = core::result::Result<T, E>;