use serde::{Deserialize, Serialize}; #[derive(Debug, thiserror::Error, Deserialize, Serialize)] pub enum InstanceError { #[error("registration failed")] RegistrationFailure, #[error("authentication failed")] AuthenticationFailed, } #[derive(Debug, thiserror::Error, Serialize, Deserialize)] pub enum RepositoryError {} #[derive(Debug, thiserror::Error, Deserialize, Serialize)] pub enum UserError {} #[derive(Debug, thiserror::Error, Serialize, Deserialize)] pub enum GetValueError { #[error("invalid object")] InvalidObject, } #[derive(Serialize, Deserialize, Debug, thiserror::Error)] pub enum OperationError { #[error("the operation was handled but an error occured")] Operation(#[from] B), #[error("an internal error occured: {0}")] Internal(String), #[error("the operation was unhandled or unrecognized")] Unhandled, }