spatie / crawler

An easy to use, powerful crawler implemented in PHP. Can execute Javascript.
https://freek.dev/308-building-a-crawler-in-php
MIT License
2.51k stars 357 forks source link

ConnectException's message is not transfered to crawlFailed #382

Closed jszczypk closed 2 years ago

jszczypk commented 2 years ago

Hi,

When ConnectException happens, in Spatie\Crawler\Handlers\CrawlRequestFailed it is converted to RequestException. However exception's message is not transfered so in CrawlObserver::crawlFailed you do not have a reason why it really failed. It happened to me when there was a timeout in Guzzle and message "cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://(...)" was lost.