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

Curl Client does not check if response code is 200 or 201 #32

Open
piwi91 opened this issue Dec 8, 2016 · 1 comment
Open

Curl Client does not check if response code is 200 or 201 #32

piwi91 opened this issue Dec 8, 2016 · 1 comment

Comments

@piwi91
Copy link

piwi91 commented Dec 8, 2016

I had an issue that I relied on your exceptions instead of the response of the CURL request. A response code of 400 couldn't be catched because there isn't an exception thrown if it occurs. An exception is only thrown when the result of the CURL request is false (https://github.com/onesky/api-library-php5/blob/master/src/Onesky/Api/Client.php#L360).
It is better to extend this check also with the CURL response code because only the expected response codes should be accepted.

@sc0rp10
Copy link

sc0rp10 commented May 25, 2017

I totally agree that code >= 400 should raise exception

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