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

ambee/giterated

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

Fix handling stack

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨c53b026

⁨giterated-models/src/error.rs⁩ - ⁨880⁩ 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 #[error("invalid object")]
20 InvalidObject,
21 }
22
23 #[derive(Serialize, Deserialize, Debug, thiserror::Error)]
24 pub enum OperationError<B> {
25 #[error("the operation was handled but an error occured")]
26 Operation(#[from] B),
27 #[error("an internal error occured: {0}")]
28 Internal(String),
29 #[error("the operation was unhandled or unrecognized")]
30 Unhandled,
31 }
32