Module error

Module error 

Source
Expand description

Error types for the Minecraft server status library.

This module provides comprehensive error handling using thiserror for all operations that can fail during server status queries.

§Example

use rust_mc_status::{McClient, ServerEdition, McError};

#[tokio::main]
async fn main() -> Result<(), McError> {
    let client = McClient::new();

    match client.ping("invalid-server", ServerEdition::Java).await {
        Ok(status) => println!("Server is online!"),
        Err(McError::Timeout) => println!("Request timed out"),
        Err(McError::DnsError(msg)) => println!("DNS error: {}", msg),
        Err(e) => println!("Other error: {}", e),
    }

    Ok(())
}

Enums§

McError
Errors that can occur during Minecraft server status queries.