use serde_json::Value;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum KamailioRpcError {
#[error("System I/O error")]
IoError(#[from] std::io::Error),
#[error("JSON (de)serialization error")]
JsonError(#[from] serde_json::Error),
#[error("Channel communication error")]
ChannelError(#[from] tokio::sync::oneshot::error::RecvError),
#[error("Kamailio error")]
KamailioError(Value),
#[error("Did neither receive a response nor an error")]
NoResponseOrError,
}