getTimezoneGeo function on WeatherService does not handle 4xx or 5xx responses

Created on 22 February 2023, almost 2 years ago
Updated 25 February 2023, almost 2 years ago

Problem/Motivation

The following error was thrown:

GuzzleHttp\Exception\ClientException: Client error: GET http://api.geonames.org//timezone?lat=35.1667&lng=33.3667&style=full&use... resulted in a 404 404 response: HTTP Status 404 – Not Found

body {font-famil (truncated...) at GuzzleHttp\Exception\RequestException::create() (line 113 of /usr/www/users/alphal/V2/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php).
Not sure why geonames returns a 404 but it happened 2 times the last 4 months. After some digging realized that GuzzleHttp client throws an error on 4xx or 5xx responses, which are not handled and causes a fatal error.
πŸ› Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡¬πŸ‡·Greece Christos Diamantis

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024