actor_sample/user_actor/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
10#[allow(dead_code)]
11pub enum UserError {
12 #[error("User not found: {0}")]
14 NotFound(String),
15
16 #[error("User already exists: {0}")]
18 AlreadyExists(String),
19
20 #[error("User validation error: {0}")]
22 ValidationError(String),
23
24 #[error("Invalid email format: {0}")]
26 InvalidEmail(String),
27
28 #[error("User database error: {0}")]
30 DatabaseError(String),
31
32 #[error("Actor communication error: {0}")]
34 ActorCommunicationError(String),
35}
36
37impl From<String> for UserError {
38 fn from(msg: String) -> Self {
39 UserError::ActorCommunicationError(msg)
40 }
41}