feat: add wooden fish play template
This commit is contained in:
23
server-rs/crates/module-wooden-fish/src/errors.rs
Normal file
23
server-rs/crates/module-wooden-fish/src/errors.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use std::fmt::{self, Display};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum WoodenFishError {
|
||||
MissingRunId,
|
||||
MissingProfileId,
|
||||
MissingOwnerUserId,
|
||||
RunNotPlaying,
|
||||
}
|
||||
|
||||
impl Display for WoodenFishError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let message = match self {
|
||||
Self::MissingRunId => "缺少 runId",
|
||||
Self::MissingProfileId => "缺少 profileId",
|
||||
Self::MissingOwnerUserId => "owner_user_id 缺失",
|
||||
Self::RunNotPlaying => "当前运行态不是 playing",
|
||||
};
|
||||
write!(f, "{message}")
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for WoodenFishError {}
|
||||
Reference in New Issue
Block a user