2020-07-23 22:46:33 +02:00
|
|
|
use thiserror::Error;
|
|
|
|
|
|
2020-08-12 14:54:03 -05:00
|
|
|
pub mod categories;
|
2020-07-23 22:46:33 +02:00
|
|
|
pub mod ids;
|
2021-03-04 20:35:23 -07:00
|
|
|
pub mod notification_item;
|
2023-07-10 16:44:40 -07:00
|
|
|
pub mod pat_item;
|
2021-05-30 15:02:07 -07:00
|
|
|
pub mod project_item;
|
2021-02-13 12:11:13 -07:00
|
|
|
pub mod report_item;
|
2023-07-07 12:20:16 -07:00
|
|
|
pub mod session_item;
|
2020-07-23 22:46:33 +02:00
|
|
|
pub mod team_item;
|
2023-04-12 17:59:43 -07:00
|
|
|
pub mod thread_item;
|
2020-09-28 10:48:15 -07:00
|
|
|
pub mod user_item;
|
2020-09-28 21:05:42 -07:00
|
|
|
pub mod version_item;
|
2020-07-23 22:46:33 +02:00
|
|
|
|
|
|
|
|
pub use ids::*;
|
2021-05-30 15:02:07 -07:00
|
|
|
pub use project_item::Project;
|
2020-07-16 10:16:35 -07:00
|
|
|
pub use team_item::Team;
|
|
|
|
|
pub use team_item::TeamMember;
|
2023-04-12 17:59:43 -07:00
|
|
|
pub use thread_item::{Thread, ThreadMessage};
|
2020-09-28 21:05:42 -07:00
|
|
|
pub use user_item::User;
|
2020-06-30 19:23:52 +02:00
|
|
|
pub use version_item::Version;
|
|
|
|
|
|
2020-07-23 22:46:33 +02:00
|
|
|
#[derive(Error, Debug)]
|
|
|
|
|
pub enum DatabaseError {
|
2021-01-28 09:07:10 -07:00
|
|
|
#[error("Error while interacting with the database: {0}")]
|
2023-07-07 12:20:16 -07:00
|
|
|
Database(#[from] sqlx::Error),
|
2020-07-23 22:46:33 +02:00
|
|
|
#[error("Error while trying to generate random ID")]
|
2022-03-27 19:12:42 -07:00
|
|
|
RandomId,
|
2023-07-07 12:20:16 -07:00
|
|
|
#[error("Error while interacting with the cache: {0}")]
|
|
|
|
|
CacheError(#[from] redis::RedisError),
|
|
|
|
|
#[error("Redis Pool Error: {0}")]
|
|
|
|
|
RedisPool(#[from] deadpool_redis::PoolError),
|
|
|
|
|
#[error("Error while serializing with the cache: {0}")]
|
|
|
|
|
SerdeCacheError(#[from] serde_json::Error),
|
2022-06-17 16:56:28 -07:00
|
|
|
}
|