Skip to main content

cp_cli_platform_project_euler/
error.rs

1#[derive(Debug, thiserror::Error)]
2pub enum Error {
3    #[error("Project Euler problem numbers must be between 1 and 65535")]
4    InvalidProblemNumber,
5    #[error("Project Euler archive pages must be between 1 and 20")]
6    InvalidArchivePage,
7    #[error("could not complete the Project Euler request; check your connection and try again")]
8    Transport(#[from] reqwest::Error),
9    #[error("Project Euler returned HTTP {0}")]
10    Status(reqwest::StatusCode),
11    #[error("Project Euler response exceeded {limit} bytes")]
12    ResponseTooLarge { limit: usize },
13    #[error("Project Euler could not find that public problem")]
14    NotFound,
15    #[error("Project Euler returned incomplete or inconsistent problem data")]
16    InvalidResponse,
17}