Add list_shops function, improve error messages

This commit is contained in:
2020-10-19 01:09:28 -04:00
parent e0f0f26943
commit 36a6c38b41
6 changed files with 202 additions and 32 deletions

View File

@@ -185,7 +185,7 @@ pub extern "C" fn get_merchandise_list(
match client.get(url).header("Api-Key", api_key).send() {
Ok(resp) => {
info!("get_merchandise_list response from api: {:?}", &resp);
if !resp.status().is_server_error() {
if resp.status().is_success() {
let bytes = resp.bytes()?;
update_file_cache(&cache_path, &bytes)?;
let json = serde_json::from_slice(&bytes)?;