MASSIVE REFACTOR

This commit is contained in:
Cutieguwu
2025-03-27 13:04:02 -04:00
parent ab4522ba2d
commit a69556c33b
14 changed files with 174 additions and 2 deletions

35
gamelog/src/error.rs Normal file
View File

@@ -0,0 +1,35 @@
use std::{fmt, io};
#[derive(Debug)]
pub enum LogFileError {
FailedToOpen(io::Error),
RonSpannedError(ron::error::SpannedError),
CompatibilityCheck(semver::Version),
}
impl fmt::Display for LogFileError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::FailedToOpen(err) => write!(f, "{}", err),
Self::CompatibilityCheck(ver) => write!(
f,
"GameLogs cannot be older than {}, but {} was found in logfile.",
crate::MIN_VER.to_string(),
ver.to_string()
),
Self::RonSpannedError(err) => write!(f, "{}", err),
}
}
}
pub enum DownError {
NotKickoff,
}
impl fmt::Display for DownError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
Self::NotKickoff => write!(f, "Variant was not Down::Kickoff."),
}
}
}