1#[cfg(feature = "protocol")]
2use crate::protocol::CodecError;
3
4#[derive(thiserror::Error, Debug)]
6pub enum Error {
7 #[error("Failed to parse JSON data")]
9 ParseError(#[source] serde_json::Error),
10 #[error("File not found")]
12 FileNotFound(#[source] std::io::Error),
13 #[error("Permission denied")]
15 PermissionDenied(#[source] std::io::Error),
16 #[error("Error reading data from file")]
18 ReadError(#[source] std::io::Error),
19 #[cfg(feature = "protocol")]
20 #[error("An error occurred when communicating with the server")]
22 CommunicationFailure(#[from] CodecError),
23}
24
25pub type Result<T> = std::result::Result<T, Error>;