mirror of
https://github.com/daledavies/jump.git
synced 2026-02-26 16:20:47 +01:00
Issue #59: Show content on weather API error
This commit is contained in:
@@ -61,7 +61,7 @@ class Weather extends AbstractAPI {
|
||||
curl_close($ch);
|
||||
// If we had an error then return the error message and exit, otherwise return the API response.
|
||||
if (isset($curlerror)) {
|
||||
http_response_code(400);
|
||||
http_response_code(curl_getinfo($ch)['http_code']);
|
||||
die(json_encode(['error' => $curlerror]));
|
||||
}
|
||||
return $response;
|
||||
|
||||
Reference in New Issue
Block a user