You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Review the exceptions that Guzzle can throw when misconfigured or endpoint is unreachable. Confirm that these exceptions are handled and if not fix/add exceptions.
Review the cloudflare API here and look for the different exceptions. If any are not handled add them
You could probably add tests that mock Guzzle, and force a specific response exception to be thrown.
I think....
$client = $this->getMockBuilder('\GuzzleHttp\Client')
->disableOriginalConstructor()
->getMock();
$client->expects($this->any())
->method('request')
// Probably need to pass in some mocks into the exception object too.
->will($this->throwException(new \GuzzleHttp\Exception\RequestException));
Also, depending on guzzle "dev-master" might not be the best for stability.
Business Requirements
Background
The PHP SDK attempts to consolidate as much exception handling into a central location here:
https://github.com/d8-contrib-modules/cloudflarephpsdk/blob/master/src/ApiEndpoints/CloudFlareAPI.php#L123
The code is designed to throw typed exceptions when a problem happens and expects the implementing code to handle these exceptions:
https://github.com/d8-contrib-modules/cloudflarephpsdk/tree/master/src/Exceptions
Technical Requirements
https://github.com/d8-contrib-modules/cloudflarephpsdk/blob/master/tests/ApiEndpoints/ZoneApiTest.php
and
https://github.com/d8-contrib-modules/cloudflarephpsdk/blob/master/tests/ApiEndpoints/ZoneSettingsApiTest.php
The text was updated successfully, but these errors were encountered: