Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
system.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2013 at 03:42 UTC
Updated:
29 Jul 2014 at 21:53 UTC
Jump to comment: Most recent file
Comments
Comment #1
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 commentedThanks Berdir for the helpful link. Here is another patch handling RequestException as well.
Comment #5
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 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 commentedmaybe instead of mentioning Guzzle would be better to say http client service?
Comment #13
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 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!