naia_client_socket/
error.rs

1use std::{error::Error, fmt};
2
3/// An Error type specifically related to the Naia Client Socket
4/// This is under construction and needs to be cleaned up
5#[derive(Debug)]
6pub enum NaiaClientSocketError {
7    /// A simple error message
8    Message(String),
9    /// An error indicating an inability to send to the given address
10    SendError,
11}
12
13impl fmt::Display for NaiaClientSocketError {
14    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
15        match self {
16            NaiaClientSocketError::Message(msg) => write!(f, "Naia Client Socket Error: {}", msg),
17            NaiaClientSocketError::SendError => write!(f, "Naia Client Socket Send Error"),
18        }
19    }
20}
21
22impl Error for NaiaClientSocketError {}