Skip to content

Commit

Permalink
Merge pull request #133 from ilumos/patch-2
Browse files Browse the repository at this point in the history
Throw an exception on empty response
  • Loading branch information
nicekiwi authored Apr 27, 2024
2 parents 09974ab + a742418 commit 48e9354
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Syntax/SteamApi/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ protected function sendRequest(Request $request)
} catch (Exception $e) {
throw new ApiCallFailedException($e->getMessage(), $e->getCode(), $e);
}

// For some resources, the Steam API responds with an empty response
if (empty($result->body)) {
throw new ApiCallFailedException('API call failed due to empty response', $result->code);
}

// If all worked out, return the result
return $result;
Expand Down

0 comments on commit 48e9354

Please sign in to comment.