ephemeris_forge_github/config/
error.rs1use ephemeris_forge::VariableNameError;
2
3use super::{ActorType, EnvironmentName, KeyPrefix, RulesetName, WebhookUrl};
4
5#[derive(Debug, thiserror::Error)]
7pub enum ConfigError {
8 #[error("autolink \"{key_prefix}\" has a URL template without <num>")]
10 AutolinkTemplateWithoutNumber {
11 key_prefix: KeyPrefix,
13 },
14 #[error("webhook \"{url}\" declares no events")]
16 EmptyWebhookEvents {
17 url: WebhookUrl,
19 },
20 #[error("environment \"{environment}\" waits {minutes} minutes, GitHub allows at most 43200")]
22 EnvironmentWaitTimer {
23 environment: EnvironmentName,
25 minutes: u32,
27 },
28 #[error("environment \"{environment}\" has {count} reviewers, GitHub allows at most 6")]
30 TooManyEnvironmentReviewers {
31 environment: EnvironmentName,
33 count: usize,
35 },
36 #[error(
38 "environment \"{environment}\" sets both protected_branches and custom_branch_policies"
39 )]
40 ConflictingDeploymentBranchPolicy {
41 environment: EnvironmentName,
43 },
44 #[error("environment \"{environment}\" has branch policies but custom_branch_policies is off")]
46 BranchPoliciesWithoutCustom {
47 environment: EnvironmentName,
49 },
50 #[error("ruleset \"{ruleset}\" has a {actor_type} bypass actor without an actor_id")]
52 MissingActorId {
53 ruleset: RulesetName,
55 actor_type: ActorType,
57 },
58 #[error("ruleset \"{ruleset}\" has a {actor_type} bypass actor with an actor_id")]
60 UnexpectedActorId {
61 ruleset: RulesetName,
63 actor_type: ActorType,
65 },
66 #[error("ruleset \"{ruleset}\" allows no merge method")]
68 NoMergeMethods {
69 ruleset: RulesetName,
71 },
72 #[error(transparent)]
74 VariableName(#[from] VariableNameError),
75}