Skip to content

Commit

Permalink
updated code to print better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mvonbodun committed May 3, 2022
1 parent 8cbbff6 commit b93be68
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion impex/src/brands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub async fn load_brands(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
1 change: 0 additions & 1 deletion impex/src/categories.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use anyhow::{Context, Result};
use log::*;
use std::collections::HashMap;
use std::error::Error;
use std::fs::File;

use reqwest::{Client, StatusCode};
Expand Down
2 changes: 1 addition & 1 deletion impex/src/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub async fn load_inventory(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
2 changes: 1 addition & 1 deletion impex/src/prices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub async fn load_prices(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
2 changes: 1 addition & 1 deletion impex/src/products.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub async fn load_products(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
2 changes: 1 addition & 1 deletion impex/src/productspecassociation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ pub async fn load_product_spec_associations(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
2 changes: 1 addition & 1 deletion impex/src/similarcategories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub async fn load_similar_categories(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
2 changes: 1 addition & 1 deletion impex/src/skuean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub async fn load_sku_eans(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
2 changes: 1 addition & 1 deletion impex/src/skufiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub async fn load_sku_files(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
5 changes: 3 additions & 2 deletions impex/src/skus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ pub async fn load_skus(
for line in rdr.deserialize() {
let mut record: Sku = line?;
debug!("sku_record: {:?}", record);
if record.id.is_none() {
if record.product_id.is_none() {
debug!("record.product_id was none");
let product_id: i32;
if !product_lookup.contains_key(&record.product_ref_id) {
product_id = utils::get_product_by_ref_id(
Expand Down Expand Up @@ -85,7 +86,7 @@ pub async fn load_skus(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
2 changes: 1 addition & 1 deletion impex/src/skuspecassociation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ pub async fn load_sku_spec_associations(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
2 changes: 1 addition & 1 deletion impex/src/specificationgroups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub async fn load_specification_groups(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
2 changes: 1 addition & 1 deletion impex/src/specifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ pub async fn load_specifications(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down
2 changes: 1 addition & 1 deletion impex/src/specificationvalues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub async fn load_specification_values(
bodies
.for_each(|b| async {
match b {
Ok(_b) => (),
Ok(b) => info!("output: {:?}", b),
Err(e) => error!("error: {:?}", e),
}
})
Expand Down

0 comments on commit b93be68

Please sign in to comment.