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

Fatal error: Uncaught TypeError: Example\GuzzleTimerMiddleware::onResponse(): Argument #3 ($response) must be of type GuzzleHttp\Promise\FulfilledPromise, GuzzleHttp\Promise\RejectedPromise given #104

Open
RobertEcker opened this issue May 12, 2024 · 0 comments

Comments

@RobertEcker
Copy link

Hi - great work,

I tried to crawl my own website and got the following errors (renamed the domain name) - interestingly other domains worked fine (e.g., example.com - although

Warning: file_get_contents(https://example.com/robots.txt): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
 in D:\adstxt\php-spider\src\Filter\Prefetch\RobotsTxtDisallowFilter.php on line 45

but I think the error is not catched ...

Crawling.
Fatal error: Uncaught TypeError: Example\GuzzleTimerMiddleware::onResponse(): Argument #3 ($response) must be of type GuzzleHttp\Promise\FulfilledPromise, GuzzleHttp\Promise\RejectedPromise given, called in C:\php-spider\vendor\guzzlehttp\guzzle\src\Middleware.php on line 144 and defined in C:\php-spider\example\lib\Example\GuzzleTimerMiddleware.php on line 33

TypeError: Example\GuzzleTimerMiddleware::onResponse(): Argument #3 ($response) must be of type GuzzleHttp\Promise\FulfilledPromise, GuzzleHttp\Promise\RejectedPromise given, called in C:\php-spider\vendor\guzzlehttp\guzzle\src\Middleware.php on line 144 in C:\php-spider\example\lib\Example\GuzzleTimerMiddleware.php on line 33

Call Stack:
    0.0008     602328   1. {main}() C:\php-spider\example\example_complex.php:0
    0.1850    2424688   2. VDB\Spider\Spider->crawl() C:\php-spider\example\example_complex.php:102
    0.1864    2441312   3. VDB\Spider\Spider->doCrawl() C:\php-spider\src\Spider.php:101
    0.1905    2580408   4. VDB\Spider\Downloader\Downloader->download($uri = class VDB\Spider\Uri\DiscoveredUri { protected VDB\Uri\UriInterface|string $decorated = class VDB\Uri\Http { private string ${VDB\Uri\Uri}uri = 'https://myprivatewebsite.com'; protected VDB\Uri\Uri $baseUri = *uninitialized*; private string ${VDB\Uri\Uri}remaining = ''; private ?string ${VDB\Uri\Uri}composedURI = 'https://myprivatewebsite.com/'; protected ?string $authority = 'myprivatewebsite.com'; protected ?string $userInfo = NULL; protected ?string $scheme = 'https'; protected ?string $host = 'myprivatewebsite.com'; protected ?int $port = NULL; protected ?string $path = '/'; protected ?string $query = NULL; protected ?string $fragment = NULL; protected ?string $username = NULL; protected ?string $password = NULL }; private int $depthFound = 0 }) C:\php-spider\src\Spider.php:177
    0.1905    2580408   5. VDB\Spider\Downloader\Downloader->fetchResource($uri = class VDB\Spider\Uri\DiscoveredUri { protected VDB\Uri\UriInterface|string $decorated = class VDB\Uri\Http { private string ${VDB\Uri\Uri}uri = 'https://myprivatewebsite.com'; protected VDB\Uri\Uri $baseUri = *uninitialized*; private string ${VDB\Uri\Uri}remaining = ''; private ?string ${VDB\Uri\Uri}composedURI = 'https://myprivatewebsite.com/'; protected ?string $authority = 'myprivatewebsite.com'; protected ?string $userInfo = NULL; p

Thanks
Robert

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

1 participant