github_proxy/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum ConversionError {
5    #[error(
6        "Invalid proxy type: {0}\nSupported types: github, gh-proxy, xget, jsdelivr, statically"
7    )]
8    InvalidProxyType(String),
9
10    #[error("Invalid resource type: {0}\nSupported types: file, release")]
11    InvalidResourceType(String),
12
13    #[error("Invalid arguments: {0}")]
14    InvalidArguments(String),
15
16    #[error(
17        "Invalid GitHub URL: {0}\nSupported formats:\n  - https://github.com/{{owner}}/{{repo}}/raw/{{ref}}/{{path}}\n  - https://github.com/{{owner}}/{{repo}}/blob/{{ref}}/{{path}}\n  - https://github.com/{{owner}}/{{repo}}/releases/download/{{tag}}/{{filename}}"
18    )]
19    InvalidUrl(String),
20
21    #[error("URL parse error: {0}")]
22    ParseError(String),
23}