minecraft_registry_api 1.4.2

Typed API clients for Minecraft modding platforms — Modrinth, Mojang, Paper, Purpur, Fabric, Forge, NeoForge
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use thiserror::Error;

#[derive(Debug, Error)]
pub enum ApiError {
    #[error("HTTP request failed: {0}")]
    Http(#[from] reqwest::Error),
    #[error("{0}")]
    Msg(String),
    #[error("XML parsing failed: {0}")]
    Xml(String),
}

impl From<String> for ApiError {
    fn from(s: String) -> Self {
        Self::Msg(s)
    }
}