OneLauncher-Cracked/packages/oneclient_core/src/error.rs
LynithDev 9ab0a0ecdd
Freya rewrite
This is v2 of OneClient. Removed all web-related stuff.

Co-Authored-By: Julian Chang <wyvest@polyfrost.org>
2026-07-05 16:37:05 -04:00

72 lines
1.8 KiB
Rust

use thiserror::Error;
#[derive(Debug, Error)]
pub enum LauncherError {
#[error("Unable to parse JSON: {0}")]
JsonError(#[from] serde_json::Error),
#[error("Database execution failed: {0}")]
DatabaseError(#[from] sqlx::Error),
#[error(transparent)]
IoError(#[from] polyio::IOError),
#[error(transparent)]
StdIoError(#[from] std::io::Error),
#[error(transparent)]
RequestError(#[from] crate::http::RequestError),
#[error("Could not resolve launcher data directory")]
DataDirUnavailable,
#[error(transparent)]
DbError(#[from] oneclient_db::DbError),
#[error("launcher core is not initialized")]
NotInitialized,
#[error("launcher core is already initialized")]
AlreadyInitialized,
#[error("invalid settings profile: {reason}")]
InvalidSettingsProfile { reason: String },
#[error(transparent)]
JavaError(#[from] crate::java::JavaError),
#[error(transparent)]
UrlError(#[from] url::ParseError),
#[error(transparent)]
NotificationError(#[from] crate::notification::NotificationError),
#[error(transparent)]
PackageError(#[from] crate::packages::PackageError),
#[error(transparent)]
AuthError(#[from] crate::auth::AuthError),
#[error(transparent)]
ClusterError(#[from] crate::clusters::ClusterError),
#[error(transparent)]
MetadataError(#[from] crate::metadata::MetadataError),
#[error(transparent)]
BundleError(#[from] crate::bundles::BundleError),
#[error(transparent)]
GameError(#[from] crate::game::GameError),
#[error(transparent)]
LogsError(#[from] crate::logs::LogsError),
#[error(transparent)]
ScreenshotsError(#[from] crate::screenshots::ScreenshotsError),
#[error("minecraft: {0}")]
Minecraft(String),
}
pub type LauncherResult<T> = Result<T, LauncherError>;