mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 15:44:35 +01:00
Increase read_file verbosity
Changed the error message that gets printed when Culti tries to read a file, but fails.
This commit is contained in:
@@ -131,11 +131,10 @@ pub fn read_file(path: String) -> String {
|
|||||||
let mut file = match fs::File::open(path_buf) {
|
let mut file = match fs::File::open(path_buf) {
|
||||||
Ok(file) => file,
|
Ok(file) => file,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
println!("Failed to open file {}: {}", &path, e);
|
||||||
if path.contains("config") {
|
if path.contains("config") {
|
||||||
// Server.ts won't print the error so handle the message here for the user
|
// Server.ts won't print the error so handle the message here for the user
|
||||||
println!("Server config not found or invalid. Be sure to run the server at least once to generate it before making edits.");
|
println!("Server config not found or invalid. Be sure to run the server at least once to generate it before making edits.");
|
||||||
} else {
|
|
||||||
println!("Failed to open file: {}", e);
|
|
||||||
}
|
}
|
||||||
return String::new(); // Send back error for handling by the caller
|
return String::new(); // Send back error for handling by the caller
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user