Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch error handling in Kiyoh and setting timeouts #28

Open
jbertoen opened this issue Dec 29, 2020 · 1 comment
Open

Catch error handling in Kiyoh and setting timeouts #28

jbertoen opened this issue Dec 29, 2020 · 1 comment

Comments

@jbertoen
Copy link

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.

@JKetelaar
Copy link
Owner

I've had quite a few issues with this as well.
I solved this problem by creating my own cache layer and updating the local data using a cron every x hours.

What backend are you using?
Are you interested in having this micro service publicly available as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants