1#![deny(unknown_lints)]
2#![deny(renamed_and_removed_lints)]
3#![forbid(unsafe_code)]
4#![deny(deprecated)]
5#![forbid(private_interfaces)]
6#![forbid(private_bounds)]
7#![forbid(non_fmt_panics)]
8#![deny(unreachable_code)]
9#![deny(unreachable_patterns)]
10#![forbid(unused_doc_comments)]
11#![forbid(unused_must_use)]
12#![deny(while_true)]
13#![deny(unused_parens)]
14#![deny(redundant_semicolons)]
15#![deny(non_ascii_idents)]
16#![deny(confusable_idents)]
17#![warn(missing_docs)]
18#![warn(clippy::missing_docs_in_private_items)]
19#![warn(clippy::cargo_common_metadata)]
20#![warn(rustdoc::missing_crate_level_docs)]
21#![deny(rustdoc::broken_intra_doc_links)]
22#![warn(missing_debug_implementations)]
23#![deny(clippy::mod_module_files)]
24#![warn(clippy::redundant_else)]
26#![warn(clippy::must_use_candidate)]
27#![warn(clippy::missing_panics_doc)]
28#![warn(clippy::missing_errors_doc)]
29#![doc = include_str!("../README.md")]
30
31pub mod api;
32
33use thiserror::Error;
34
35#[derive(Debug, Error)]
37pub enum Error {
38 #[error("reqwest error: {0}")]
40 ReqwestError(#[from] reqwest::Error),
41 #[error("error in json serialization/deserialization: {0}")]
43 SerdeJsonError(#[from] serde_json::Error),
44 #[error("error when parsing URL: {0}")]
46 UrlParseError(#[from] url::ParseError),
47 #[error("error when reading environment variables: {0}")]
49 EnvyError(#[from] envy::Error),
50 #[error("empty response body with status: {0}")]
52 EmptyResponseBody(reqwest::StatusCode),
53 #[error("JSON but non-object response body with status: {0}")]
55 NonObjectResponseBody(reqwest::StatusCode),
56 #[error("JSON wrapper pagination key missing: {0}")]
58 PaginationKeyMissing(String),
59 #[error("JSON wrapper pagination key has an unexpected type: {0}")]
61 PaginationKeyHasWrongType(String),
62 #[error("Parsing string {0} to time object failed")]
64 TimeParseError(String, time::error::Parse),
65 #[error("Error when opening or reading file {0} to upload: {1}")]
67 UploadFileError(std::path::PathBuf, std::io::Error),
68}