diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-10-18 18:46:05 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-10-18 18:46:05 +0800 |
| commit | 4d98cd98debba7de222985ef9351cf0b6f60ff9b (patch) | |
| tree | 91021212e34024b1609b0d03867ce4df3fc20184 /crates/utils | |
| parent | 4810f56e6a49b60923eb850d5944457650c81c75 (diff) | |
Update `config.rs`
- If config file not exist, now return Error
Diffstat (limited to 'crates/utils')
| -rw-r--r-- | crates/utils/cfg_file/src/config.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/utils/cfg_file/src/config.rs b/crates/utils/cfg_file/src/config.rs index 0211e75..a1eb301 100644 --- a/crates/utils/cfg_file/src/config.rs +++ b/crates/utils/cfg_file/src/config.rs @@ -57,7 +57,10 @@ pub trait ConfigFile: Serialize + for<'a> Deserialize<'a> + Default { // Check if file exists if fs::metadata(&file_path).await.is_err() { - return Ok(Self::DataType::default()); + return Err(std::io::Error::new( + std::io::ErrorKind::NotFound, + "Config file not found", + )); } // Open file |
