aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 4e3076b..17f443b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -30,10 +30,15 @@ fn main() {
).get_matches();
let start_time = SystemTime::now();
- let r = BufReader::new(File::open(args.value_of("PHISHTANK").unwrap()).unwrap());
- let tank = phisher::load_phistank(r).unwrap();
+ let filename = args.value_of("PHISHTANK").unwrap();
+ if let Ok(file) = File::open(filename) {
+ let tank = phisher::load_phistank(BufReader::new(file)).unwrap();
- println!("Loaded {} phishes in {} seconds!",
- tank.phishes.len(),
- start_time.elapsed().unwrap().as_secs());
+ println!("Loaded {} phishes in {} seconds!",
+ tank.phishes.len(),
+ start_time.elapsed().unwrap().as_secs());
+ }
+ else {
+ eprintln!("Could not open file {}.\nIs the filename correct?", filename);
+ }
}