Skip to main content

vial_srv/
errors.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum ServerError {
5    #[error("Both view count and expiration cannot be empty")]
6    ViewAndExpireEmpty,
7    #[error("Invalid expiration value. It must be in the future with max 30 day")]
8    InvalidExpire,
9    #[error("Invalid view count. It must be between 1 and 1000")]
10    InvalidViewCount,
11    #[error("Database error: {0}")]
12    DatabaseError(String),
13}