Skip to content

Catch error handling in Kiyoh and setting timeouts #28

Description

@jbertoen

During a maintenance window we experienced issues using this library, because the api was not accessible. The reason we experienced issues is because of some limitations to use this library, and therefor could not resolve ourselves.

GuzzleHttp\Exception\ServerException: Server error: GET https://www.kiyoh.com/v1/review/feed.xml?hash=vt01oddgbpuuir3&limit=0 resulted in a 504 Gateway Time-out response: <title>504 Gateway Time-out</title>

504 Gateway Time-out

< (truncated...) in GuzzleHttp\Exception\RequestException::create() (line 113 of /var/www/html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php).

First issue is to try and catch errors when sending the request. To prevent the above for instance. And then send a generic exception yourself with some information.

Second issue is no validation if the response is accurate to use. Like, check if the response has a status code 200. If not, throw an exception. Which an implementation of this library could catch.

Third issue is that there is no way to set the max timeout for sending a request. Can't give any options when creating a new Kiyoh object that could be passed to the guzzle client.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions