use std::{io, result};
use thiserror::Error;
#[derive(Error, Debug)]
pub enum RefractiumError {
#[error("Failed to bind to {0}: {1}")]
BindError(String, io::Error),
#[error("Configuration error: {0}")]
ConfigError(String),
#[error("IO error: {0}")]
Io(#[from] io::Error),
#[error("Address resolution failed: {0}")]
AddrResolution(String),
#[error("Generic error: {0}")]
Generic(String),
#[error("Unknown error occurred")]
Unknown,
}
pub type Result<T> = result::Result<T, RefractiumError>;