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

Status code must be an integer value between 1xx and 5xx. #2751

Closed
cappadaan opened this issue Sep 4, 2020 · 4 comments
Closed

Status code must be an integer value between 1xx and 5xx. #2751

cappadaan opened this issue Sep 4, 2020 · 4 comments

Comments

@cappadaan
Copy link

Guzzle version(s) affected: 7.0.1
PHP version: 7.4.9
cURL version: 7.64.1

Lately I run into this randomly fatal error

"PHP Fatal error: Uncaught InvalidArgumentException: Status code must be an integer value between 1xx and 5xx. "

The error message is not clear at all and causes confusion. Does the URL gives me a invalid status header? Which call causes this error and why? Is there an option to catch this error, because so far I am not able to.

I think it is related to issue: #2534
Is this a known problem?

@kekodmc
Copy link

kekodmc commented Sep 16, 2020

\vendor\guzzlehttp\psr7\src\Response.php 151

@strarsis
Copy link

strarsis commented Sep 19, 2020

Composer-based patch: spatie/crawler#271 (comment)

@Nyholm
Copy link
Member

Nyholm commented Oct 1, 2020

The status code in the HTTP response must be between 100 and 599.

This is related to Guzzle/psr7.

@Nyholm Nyholm closed this as completed Oct 1, 2020
@williamjulianvicary
Copy link
Contributor

@strarsis This issue is different to #2534 which was related to this exception causing issues when encountering it with a Pool - the PR that was just merged fixes the issues that caused the Pool to misbehave, but does not resolve the issue of not being able to review the raw response that triggered the PSR7 response InvalidArgumentException.

This issue is still relevant in my opinion (guzzle/psr7#349) and I'll comment over there.

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

5 participants