use starlang_core::Pid;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum RuntimeError {
#[error("process not found: {0}")]
ProcessNotFound(Pid),
#[error("send failed: {0}")]
SendFailed(#[from] SendError),
#[error("spawn failed: {0}")]
SpawnFailed(#[from] SpawnError),
}
#[derive(Debug, Error)]
pub enum SendError {
#[error("process not found: {0}")]
ProcessNotFound(Pid),
#[error("mailbox full")]
MailboxFull,
#[error("process terminated")]
ProcessTerminated,
}
#[derive(Debug, Error)]
pub enum SpawnError {
#[error("failed to create process task: {0}")]
TaskCreationFailed(String),
#[error("process initialization failed: {0}")]
InitFailed(String),
}