mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Display errors when loading ShapedDevices
This commit is contained in:
1
src/rust/Cargo.lock
generated
1
src/rust/Cargo.lock
generated
@@ -1294,6 +1294,7 @@ dependencies = [
|
||||
"csv",
|
||||
"ip_network",
|
||||
"ip_network_table",
|
||||
"log",
|
||||
"serde",
|
||||
"sha2",
|
||||
"toml",
|
||||
|
||||
@@ -12,3 +12,4 @@ ip_network_table = "0"
|
||||
ip_network = "0"
|
||||
sha2 = "0"
|
||||
uuid = { version = "1", features = ["v4", "fast-rng" ] }
|
||||
log = "0"
|
||||
|
||||
@@ -35,12 +35,17 @@ impl ConfigShapedDevices {
|
||||
let mut reader = csv::Reader::from_path(final_path)?;
|
||||
|
||||
// Example: StringRecord(["1", "968 Circle St., Gurnee, IL 60031", "1", "Device 1", "", "", "192.168.101.2", "", "25", "5", "10000", "10000", ""])
|
||||
|
||||
let mut devices = Vec::new();
|
||||
for result in reader.records() {
|
||||
if let Ok(result) = result {
|
||||
if let Ok(device) = ShapedDevice::from_csv(&result) {
|
||||
devices.push(device);
|
||||
} else {
|
||||
log::error!("Error reading Device line: {:?}", &result);
|
||||
}
|
||||
} else {
|
||||
log::error!("Error reading CSV record: {:?}", result);
|
||||
}
|
||||
}
|
||||
let trie = ConfigShapedDevices::make_trie(&devices);
|
||||
|
||||
Reference in New Issue
Block a user