use std::io;
use std::path::PathBuf;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum CjseqError {
#[error("CityJSON error: {0}")]
CityJsonError(String),
#[error("Failed to parse JSON: {0}")]
JsonParseError(#[from] serde_json::Error),
#[error("I/O error: {0}")]
IoError(#[from] io::Error),
#[error("File not found: {0}")]
FileNotFound(PathBuf),
#[error("Missing required field: {0}")]
MissingField(String),
#[error("Invalid value for {field}: {reason}")]
InvalidValue { field: String, reason: String },
#[cfg(not(target_arch = "wasm32"))]
#[error("HTTP error: {0}")]
HttpError(#[from] reqwest::Error),
#[cfg(target_arch = "wasm32")]
#[error("HTTP error: {0}")]
GlooHttpError(#[from] gloo_net::Error),
#[error("{0}")]
Generic(String),
}
pub type Result<T> = std::result::Result<T, CjseqError>;