fix: improve error messages

This commit is contained in:
monosans
2025-09-30 07:53:39 +03:00
parent 2f41cfba16
commit e522bf45f2
5 changed files with 28 additions and 24 deletions
+2 -2
View File
@@ -182,9 +182,9 @@ pub fn get_config_path() -> String {
pub async fn read_config(path: &Path) -> crate::Result<RawConfig> {
let raw_config =
tokio::fs::read_to_string(path).await.wrap_err_with(move || {
format!("failed to read {} to string", path.display())
format!("failed to read file to string: {}", path.display())
})?;
toml::from_str(&raw_config).wrap_err_with(move || {
format!("failed to parse {} as TOML config file", path.display())
format!("failed to parse TOML config file: {}", path.display())
})
}