Error handling. Returned errors if CSV import failed. Resolves #14.
This commit is contained in:
parent
c9c663bf3d
commit
9b3eb053b2
|
@ -70,7 +70,7 @@ pub fn import_and_process_final(
|
||||||
println!("\nFailed to import accounts and transactions from CSV.");
|
println!("\nFailed to import accounts and transactions from CSV.");
|
||||||
println!("{}", err);
|
println!("{}", err);
|
||||||
|
|
||||||
return Err(err);
|
return Err(err)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -90,7 +90,12 @@ pub fn import_and_process_final(
|
||||||
|
|
||||||
match csv_import_accts_txns::import_accounts(&mut rdr, raw_acct_map, acct_map) {
|
match csv_import_accts_txns::import_accounts(&mut rdr, raw_acct_map, acct_map) {
|
||||||
Ok(()) => {}
|
Ok(()) => {}
|
||||||
Err(err) => { println!("\nFailed to import accounts from CSV."); println!("{}", err); }
|
Err(err) => {
|
||||||
|
println!("\nFailed to import accounts from CSV.");
|
||||||
|
println!("{}", err);
|
||||||
|
|
||||||
|
return Err(err)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
match csv_import_accts_txns::import_transactions(
|
match csv_import_accts_txns::import_transactions(
|
||||||
|
@ -101,7 +106,12 @@ pub fn import_and_process_final(
|
||||||
acct_map
|
acct_map
|
||||||
) {
|
) {
|
||||||
Ok(()) => {}
|
Ok(()) => {}
|
||||||
Err(err) => { println!("\nFailed to import transactions from CSV."); println!("{}", err); }
|
Err(err) => {
|
||||||
|
println!("\nFailed to import transactions from CSV.");
|
||||||
|
println!("{}", err);
|
||||||
|
|
||||||
|
return Err(err)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in New Issue