diff --git a/src/main.rs b/src/main.rs index bb16a87..621e1ce 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use serde_derive::{Deserialize, Serialize}; use reqwest::blocking::get; -use std::fs; +use std::{fs, process::exit}; mod cloudflare; #[derive(Serialize, Deserialize)] @@ -68,7 +68,10 @@ impl Ips { match response { Ok(data) => self.ipv4 = data.text().expect("0.0.0.0").trim_end().to_owned(), - Err(e) => panic!("{:#?}", e) + Err(e) => { + println!("Could not fetch IP4, quitting"); + exit(75); + } } let response = get(ipv6uri); @@ -82,7 +85,10 @@ impl Ips { }; self.ipv6base = stripped; }, - Err(e) => panic!("{:#?}", e) + Err(e) => { + println!("Could not fetch IP6, quitting"); + exit(75); + } } } }