INNER CODE UNIT · Rust
Err
Drew-Alleman/DataSurgeon · src/plugins/mod.rs:153
if let Err(_) = file.read_to_string(&mut data) {
handle_error_and_exit("Failed to read from plugins.json file.");
return Vec::new();
}
match serde_json::from_str(&data) {
Ok(plugins) => plugins,
Err(_) => {
handle_error_and_exit("Failed to parse plugins.json. Please ensure all required fields are present.");
Vec::new() // Return an empty list of plugins if the user doesn't want to exit.
}
}
},
None => {
println!("{}", &format!("{} PLUGIN_PATH: {}", FAILED_TO_LOCATE, get_plugin_path()));
Vec::new() // Return an empty list of plugins if the user doesn't want to exit.
}
}
}