fix: better error handling
This commit is contained in:
parent
ba06d1ec0b
commit
b729c050f9
1 changed files with 10 additions and 11 deletions
|
@ -139,9 +139,7 @@ async fn get_wolves(config: &Config) -> Vec<AccountWolves> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// get wolves data
|
// get wolves data
|
||||||
let uri = &config.wolves_url;
|
if let Ok(mut res) = surf::post(&config.wolves_url).header("X-AM-Identity", &config.wolves_key).await {
|
||||||
let mut res = surf::post(uri).header("X-AM-Identity", &config.wolves_key).await.unwrap();
|
|
||||||
|
|
||||||
if let Ok(WolvesResult {
|
if let Ok(WolvesResult {
|
||||||
success,
|
success,
|
||||||
result,
|
result,
|
||||||
|
@ -153,6 +151,7 @@ async fn get_wolves(config: &Config) -> Vec<AccountWolves> {
|
||||||
|
|
||||||
return result.iter().map(AccountWolves::from).collect::<Vec<AccountWolves>>();
|
return result.iter().map(AccountWolves::from).collect::<Vec<AccountWolves>>();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vec![]
|
vec![]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue