feat(storage): 添加 StorageError 类型

This commit is contained in:
xiaoxixi 2026-04-28 22:08:47 +08:00
parent 3ed7ac7cbd
commit 22546d3ad0

16
src/storage/error.rs Normal file
View File

@ -0,0 +1,16 @@
use thiserror::Error;
#[derive(Error, Debug)]
pub enum StorageError {
#[error("session not found: {0}")]
NotFound(String),
#[error("session already exists: {0}")]
AlreadyExists(String),
#[error("database error: {0}")]
Database(#[from] sqlx::Error),
#[error("serialization error: {0}")]
Serialization(String),
}