use thiserror::Error;
#[derive(Error, Debug)]
pub enum ActorError {
#[error(transparent)]
OneshotRecv(#[from] tokio::sync::oneshot::error::RecvError),
#[error("Failed to send on unbounded channel: {0}")]
UnboundedChannelSend(String),
#[error("Failed to recv from unbounded channel")]
UnboundedChannelRecv,
#[error("Failed to send on bounded channel: {0}")]
BoundedChannelSend(String),
#[error("Failed to recv from bounded channel")]
BoundedChannelRecv,
#[error(transparent)]
AddressRegexError(#[from] regex::Error),
#[error("Address {0} already exists")]
AddressAlreadyExist(String),
#[error("Address {0} not found")]
AddressNotFound(String),
#[error("Actor that's address is {0} not ready")]
ActorNotReady(String),
#[error("Actor clone failed: {0}")]
CloneFailed(String),
#[error("Unhealthy ActorSystem")]
UnhealthyActorSystem,
#[error("Message type mismatch")]
MessageTypeMismatch,
}