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",
|
"csv",
|
||||||
"ip_network",
|
"ip_network",
|
||||||
"ip_network_table",
|
"ip_network_table",
|
||||||
|
"log",
|
||||||
"serde",
|
"serde",
|
||||||
"sha2",
|
"sha2",
|
||||||
"toml",
|
"toml",
|
||||||
|
|||||||
@@ -12,3 +12,4 @@ ip_network_table = "0"
|
|||||||
ip_network = "0"
|
ip_network = "0"
|
||||||
sha2 = "0"
|
sha2 = "0"
|
||||||
uuid = { version = "1", features = ["v4", "fast-rng" ] }
|
uuid = { version = "1", features = ["v4", "fast-rng" ] }
|
||||||
|
log = "0"
|
||||||
|
|||||||
@@ -35,12 +35,17 @@ impl ConfigShapedDevices {
|
|||||||
let mut reader = csv::Reader::from_path(final_path)?;
|
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", ""])
|
// 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();
|
let mut devices = Vec::new();
|
||||||
for result in reader.records() {
|
for result in reader.records() {
|
||||||
if let Ok(result) = result {
|
if let Ok(result) = result {
|
||||||
if let Ok(device) = ShapedDevice::from_csv(&result) {
|
if let Ok(device) = ShapedDevice::from_csv(&result) {
|
||||||
devices.push(device);
|
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);
|
let trie = ConfigShapedDevices::make_trie(&devices);
|
||||||
|
|||||||
Reference in New Issue
Block a user