data_pager/
error.rs

1use snafu::Snafu;
2
3pub(super) type Result<T, E = Error> = std::result::Result<T, E>;
4
5#[derive(Debug, Snafu)]
6#[snafu(visibility(pub(crate)))]
7pub enum Error {
8    #[snafu(display("Page size must be between 1-99. Got: {size}"))]
9    InvalidPageSize { size: u64 },
10    #[snafu(display("Source cannot be empty"))]
11    InvalidSource,
12    #[snafu(display("Invalid base64 string: {}", s))]
13    Base64Decode {
14        s: String,
15        source: base64::DecodeSliceError,
16    },
17    #[snafu(display("Invalid UTF-8 string"))]
18    InvalidUtf8 { source: std::str::Utf8Error },
19    #[snafu(display("Invalid number: {s}"))]
20    InvalidNumber {
21        s: String,
22        source: std::num::ParseIntError,
23    },
24}