Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#14 | system-download-1912594-14.patch | 2.09 KB | Berdir |
#14 | system-download-1912594-14-interdiff.txt | 1.14 KB | Berdir |
#11 | system-download-1912594-11.patch | 2.17 KB | Berdir |
#8 | guzzle.patch | 2.13 KB | krishworks |
#5 | guzzle.patch | 1.81 KB | krishworks |
Comments
Comment #1
krishworks CreditAttribution: krishworks commentedfirst attempt at changing. not sure if everything is correct. followed the method described here: http://drupal.org/node/1862446
Comment #3
BerdirThe exception handling needs to catch the RequestException as well. See #1875792: Standardize Guzzle exception handling
Comment #4
krishworks CreditAttribution: krishworks commentedThanks Berdir for the helpful link. Here is another patch handling RequestException as well.
Comment #5
krishworks CreditAttribution: krishworks commentedthe last patch was partial. Here is a complete patch.
Comment #7
BerdirYou are missing the use statements for these two exception classes, now they don't match and the exception bubbles up.
Comment #8
krishworks CreditAttribution: krishworks commentedadded appropriate 'use' statement for Exception handling.
Comment #10
BerdirYou need to call $e->getResponse() to get the response.
And this does not have a response nor http error status. You can use $e->getMessage() to get the generic curl error message, see the linked issue.
Comment #11
BerdirHere's a re-roll. Again using similar pattern for the error message as in aggregator DefaultFetcher
Comment #12
ParisLiakos CreditAttribution: ParisLiakos commentedmaybe instead of mentioning Guzzle would be better to say http client service?
Comment #13
ParisLiakos CreditAttribution: ParisLiakos commentedYou either need to change the message or fix the placeholders..i have no clue though how to get status code from Request Exception
Comment #14
BerdirBetter?
As discussed, guzzle it is, it's documented in @return now and without a generic interface, not replacable. And I prefer that over a generic service name.
Comment #15
ParisLiakos CreditAttribution: ParisLiakos commentedjust for future reviewers, "HTTP" word is left on purpose on the first message cause it will form something like:
Failed to fetch file due to HTTP error "404 not found"
which makes perfect sense:)
RTBC
Comment #16
catchCommitted/pushed to 8.x, thanks!