[#9] Added general error module
This commit is contained in:
parent
a80774b341
commit
eab31e5e91
4 changed files with 29 additions and 5 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use crate::errors::FejError;
|
||||
use regex::Regex;
|
||||
use reqwest::blocking as reqwest;
|
||||
use rocket::http::RawStr;
|
||||
|
|
@ -73,7 +74,7 @@ pub struct Street {
|
|||
/// * `street` - name of the street
|
||||
/// * `city` - city the street is in
|
||||
// TODO find out how to do this async
|
||||
pub fn search_streets(street_name: &String) -> Result<Vec<Street>, Box<dyn Error>> {
|
||||
pub fn search_streets(street_name: &String) -> Result<Vec<Street>, FejError> {
|
||||
let client = reqwest::Client::new();
|
||||
let response = client.get(SEARCH_URL).query(&[("q", street_name)]).send()?;
|
||||
let data: Vec<HashMap<String, String>> = response.json()?;
|
||||
|
|
|
|||
Reference in a new issue