200でもエラーの時があるのでsuccessも見るようにする

やり方これであってるのか?
This commit is contained in:
eai04191 2019-06-15 07:26:15 +09:00
parent c061a51f8f
commit 9306a4376c

View File

@ -26,6 +26,9 @@ class SteamResolver implements Resolver
$res = $this->client->get('https://store.steampowered.com/api/appdetails/?l=japanese&appids=' . $appid); $res = $this->client->get('https://store.steampowered.com/api/appdetails/?l=japanese&appids=' . $appid);
if ($res->getStatusCode() === 200) { if ($res->getStatusCode() === 200) {
$json = json_decode($res->getBody()->getContents(), true); $json = json_decode($res->getBody()->getContents(), true);
if($json[$appid]['success'] === false){
throw new \RuntimeException("API response [$appid][success] is false: $url");
}
$data = $json[$appid]['data']; $data = $json[$appid]['data'];
$metadata = new Metadata(); $metadata = new Metadata();