Skip to content

Commit 48e9354

Browse files
authored
Merge pull request #133 from ilumos/patch-2
Throw an exception on empty response
2 parents 09974ab + a742418 commit 48e9354

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Syntax/SteamApi/Client.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ protected function sendRequest(Request $request)
199199
} catch (Exception $e) {
200200
throw new ApiCallFailedException($e->getMessage(), $e->getCode(), $e);
201201
}
202+
203+
// For some resources, the Steam API responds with an empty response
204+
if (empty($result->body)) {
205+
throw new ApiCallFailedException('API call failed due to empty response', $result->code);
206+
}
202207

203208
// If all worked out, return the result
204209
return $result;

0 commit comments

Comments
 (0)