Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
browser system
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2015 at 21:27 UTC
Updated:
20 Nov 2015 at 09:44 UTC
Jump to comment: Most recent
Comments
Comment #2
dawehnerWell, do you have the right use statement?
Comment #3
hass commented\Drupal::httpClient() does not require "use" as it is a service!?
See http://cgit.drupalcode.org/piwik/tree/src/Form/PiwikAdminSettingsForm.ph...
Comment #4
hass commentedComment #5
hass commentedComment #6
dawehnerIt is simply how PHP work, if you use an exception class you also need to put a "use" statement in order to use it.
Comment #7
hass commentedCan you take a look into the piwik code, please?
It does not look like there is a class missing. The error happens because Guzzle fires an exception on a http status code 404. At least this is what I see in dblog logged.
Comment #8
larowlanThere is also ClientException
Comment #9
dawehner@hass
These are the use statements
you use in that particular file.
\GuzzleHttp\Exception\RequestExceptionis the one you need as well.You can also specify
$options['http_errors'] = FALSEwhen running ->get() which will stop firing the exception.Comment #10
hass commented*OMG*. Got it... that works. Many thanks.
Comment #11
dawehnerNo worries :)