use thiserror::Error;
#[derive(Debug, Error)]
pub enum RadiusError {
#[error("Verification failed for incoming Radius packet: {error}")]
ValidationError {
error: String
},
#[error("Radius packet is malformed: {error}")]
MalformedPacketError {
error: String
},
#[error("Attribute in Radius packet is malformed: {error}")]
MalformedAttributeError {
error: String
},
#[error("Provided IP Address is malformed: {error}")]
MalformedIpAddrError {
error: String
},
#[error("Provided Interface Id is malformed: {error}")]
MalformedIfIdError {
error: String
},
#[error(transparent)]
SocketConnectionError(#[from] std::io::Error),
#[error("Invalid socket connection: {error}")]
SocketInvalidConnectionError {
error: String
},
#[error(transparent)]
SocketAddrParseError(#[from] std::net::AddrParseError),
#[error("Dictionary is malformed or inaccessible")]
MalformedDictionaryError {
error: std::io::Error
},
#[error("Supplied RADIUS Code is not supported by this library: {error}")]
UnsupportedTypeCodeError {
error: String
},
}