Skip to main content

this_me/utils/
me_error.rs

1// src/utils/me_error.rs
2use thiserror::Error;
3#[cfg(feature = "sqlite")]
4use rusqlite;
5use std::io;
6use serde_json;
7
8#[derive(Debug, Error)]
9pub enum MeError {
10    #[cfg(feature = "sqlite")]
11    #[error("Database error: {0}")]
12    Database(#[from] rusqlite::Error),
13
14    #[error("IO error: {0}")]
15    Io(#[from] io::Error),
16
17    #[error("Validation error: {0}")]
18    Validation(String),
19
20    #[error("Serialization error: {0}")]
21    Serialization(#[from] serde_json::Error),
22
23    #[error("Crypto error: {0}")]
24    Crypto(String),
25}