1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum Error {
6 #[error("Missing the HTTP payload body.")]
7 MissingPayload,
8
9 #[error("Missing the `target` webhook URL.")]
10 MissingWebhookURL,
11
12 #[error("Invalid `target` webhook URL.")]
13 InvalidTargetWebhookURL,
14
15 #[error("Missing the `message` in the payload.")]
16 MissingMessage,
17
18 #[error("Invalid format / structure for `Message` in the `message` value.")]
19 InvalidMessage,
20
21 #[error("HTTP Request Error: {0}")]
22 HttpRequest(#[from] reqwest::Error),
23
24 #[error("Received invalid JSON Data: {0}")]
25 InvalidJsonData(#[from] serde_json::Error),
26
27 #[error("War Pigeon Internal Error, sorry about that try again soon.")]
28 InternalError,
29
30 #[error("Missing the API Key, please send in the X-Api-Key header.")]
31 MissingApiKey,
32
33 #[error("Invalid API Key Format, expected: {{ID}}.{{KEY}}, note the `.`")]
34 InvalidApiKeyFormat,
35
36 #[error("The provided API Key was revoked.")]
37 RevokedApiKey,
38
39 #[error("API Key was not found.")]
40 ApiKeyNotFound,
41
42 #[error("The provided API Key is invalid.")]
43 InvalidApiKey,
44
45 #[error("Account is currently inactive, please reactivate and try again.")]
46 InactiveAccount,
47
48 #[error(
49 "You have exceeded your plan limit, please upgrade your plan or wait for limit refresh."
50 )]
51 PlanLimitReached,
52}