diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-10-20 23:54:00 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-10-20 23:54:00 +0200 |
commit | 815745b4c50232ac851a52c4f130cc64f81d2076 (patch) | |
tree | e4fc1f977ecedf9c41817a336ab650142737d565 | |
parent | Crawler: Add indexer interaction skeleton (diff) | |
download | OSSE-815745b4c50232ac851a52c4f130cc64f81d2076.tar.gz OSSE-815745b4c50232ac851a52c4f130cc64f81d2076.tar.bz2 OSSE-815745b4c50232ac851a52c4f130cc64f81d2076.zip |
Crawler: Add Err string in the craw_url method
-rw-r--r-- | crawler/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crawler/src/main.rs b/crawler/src/main.rs index 999c0c0..2ffb1c7 100644 --- a/crawler/src/main.rs +++ b/crawler/src/main.rs @@ -45,18 +45,18 @@ fn crawler(root_urls: Vec<&str>) { } } -fn crawl_url(url: &str) -> Result<(String, Vec<String>), ()> { +fn crawl_url(url: &str) -> Result<(String, Vec<String>), String> { let url = "https://".to_owned() + url; println!("Crawling {:?}", url); let response_res = reqwest::blocking::get(&url); if response_res.is_err() { - return Err(()); + return Err("Error fetching ".to_owned() + &url); } let response_text_res = response_res.unwrap().text(); if response_text_res.is_err() { - return Err(()); + return Err("Error unwrapping the fetched HTML's text (".to_owned() + &url + ")"); } let response_text = response_text_res.unwrap(); |