Fix tomorrow lmao

This commit is contained in:
illegitimate-egg 2025-03-17 01:00:58 +00:00
parent 488712b71c
commit c6976db04c
4 changed files with 9 additions and 5 deletions

View File

@ -1,2 +0,0 @@
[target.'cfg(all())']
runner = "./.cargo/runner.sh"

View File

@ -1,2 +0,0 @@
#!/bin/bash
cd ../rte && exec "$@"

View File

@ -61,6 +61,6 @@ size_z = 64
.read_to_string(&mut config_data)
.expect("Failed to read config file");
Ok(toml::from_str(&config_data).expect("Failed to deserialize config.toml"))
Ok(toml::from_str(&config_data)?)
}
}

View File

@ -13,6 +13,7 @@ pub enum AppError {
TryFromIntError(TryFromIntError),
RhaiError(Box<EvalAltResult>),
MutexPoisoned(String),
DeserializerError(toml::de::Error),
InvalidWorldFile,
// InvalidExtensionVersion,
}
@ -27,6 +28,7 @@ impl fmt::Display for AppError {
AppError::TryFromIntError(err) => write!(f, "Integer conversion error: {}", err),
AppError::RhaiError(err) => write!(f, "Rhai compilation error: {}", err),
AppError::MutexPoisoned(err) => write!(f, "Poisoned mutex: {}", err),
AppError::DeserializerError(err) => write!(f, "Config Deserializer Failed: {}", err),
AppError::InvalidWorldFile => write!(f, "Invalid world file"),
// AppError::InvalidExtensionVersion => write!(f, "Invalid extension version"),
}
@ -74,3 +76,9 @@ impl<T> From<PoisonError<T>> for AppError {
AppError::MutexPoisoned(err.to_string())
}
}
impl From<toml::de::Error> for AppError {
fn from(err: toml::de::Error) -> Self {
AppError::DeserializerError(err)
}
}