feat(storage): 添加 StorageError 类型
This commit is contained in:
parent
3ed7ac7cbd
commit
22546d3ad0
16
src/storage/error.rs
Normal file
16
src/storage/error.rs
Normal 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),
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user