1use thiserror::Error;
2
3#[derive(Debug, Error, Clone, PartialEq, Eq)]
4pub enum PaftError {
6 #[error("Search query must not be empty")]
8 EmptySearchQuery,
9
10 #[error("Search limit must be greater than 0, but was {0}")]
12 InvalidSearchLimit(usize),
13
14 #[error("HistoryRequest: 'range' and 'period' are mutually exclusive")]
16 ExclusiveRangeAndPeriod,
17
18 #[error("HistoryRequest: 'period' start ({start}) must be before end ({end})")]
20 InvalidPeriod {
21 start: i64,
23 end: i64,
25 },
26
27 #[error(
29 "Invalid period format: '{format}' - expected formats like '2023Q4', '2023', 'FY2023', '2023-12-31', or '12/31/2023'"
30 )]
31 InvalidPeriodFormat {
32 format: String,
34 },
35}