1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum AuthError {
8 #[error("not found: {0}")]
10 NotFound(String),
11
12 #[error("permission denied: {0}")]
14 PermissionDenied(String),
15
16 #[error("already exists: {0}")]
18 AlreadyExists(String),
19
20 #[error("invalid input: {0}")]
22 InvalidInput(String),
23
24 #[error("cannot remove last owner of organization")]
26 LastOwner,
27
28 #[error("branch '{0}' is protected: {1}")]
30 BranchProtected(String, String),
31
32 #[error("invalid webhook: {0}")]
34 InvalidWebhook(String),
35
36 #[error("serialization error: {0}")]
38 Serialization(String),
39}
40
41pub type Result<T> = std::result::Result<T, AuthError>;