JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Begin new protocol refactor

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨26651b1

⁨giterated-models/src/error.rs⁩ - ⁨824⁩ bytes
Raw
1 use serde::{Deserialize, Serialize};
2
3 #[derive(Debug, thiserror::Error, Deserialize, Serialize)]
4 pub enum InstanceError {
5 #[error("registration failed")]
6 RegistrationFailure,
7 #[error("authentication failed")]
8 AuthenticationFailed,
9 }
10
11 #[derive(Debug, thiserror::Error, Serialize, Deserialize)]
12 pub enum RepositoryError {}
13
14 #[derive(Debug, thiserror::Error, Deserialize, Serialize)]
15 pub enum UserError {}
16
17 #[derive(Debug, thiserror::Error, Serialize, Deserialize)]
18 pub enum GetValueError {}
19
20 #[derive(Serialize, Deserialize, Debug, thiserror::Error)]
21 pub enum OperationError<B> {
22 #[error("the operation was handled but an error occured")]
23 Operation(#[from] B),
24 #[error("an internal error occured")]
25 Internal(String),
26 #[error("the operation was unhandled or unrecognized")]
27 Unhandled,
28 }
29