use thiserror::Error;
#[derive(Error, Debug)]
pub enum SimulatorError {
#[error("Failed to start server: {0}")]
ServerStart(String),
#[error("Failed to bind to address: {0}")]
BindError(String),
#[error("Invalid configuration: {0}")]
InvalidConfiguration(String),
#[error("Timeout occurred: {0}")]
Timeout(String),
#[error("Invocation not found: {0}")]
InvocationNotFound(String),
}
#[derive(Error, Debug)]
pub enum RuntimeError {
#[error("Request ID not found: {0}")]
RequestIdNotFound(String),
#[error("Invalid request ID format: {0}")]
InvalidRequestId(String),
#[error("No invocation available")]
NoInvocation,
#[error("Runtime not initialized")]
NotInitialized,
#[error("Runtime already initialized")]
AlreadyInitialized,
#[error("Invalid payload: {0}")]
InvalidPayload(String),
}
#[derive(Error, Debug)]
pub enum BuilderError {
#[error("Missing required field: {0}")]
MissingField(String),
#[error("Invalid freeze configuration: {0}")]
InvalidFreezeConfig(String),
}
pub type SimulatorResult<T> = Result<T, SimulatorError>;
pub type RuntimeResult<T> = Result<T, RuntimeError>;