Skip to content

Error handling needs to be improved when Incorrect Cloudflare API key is set. #301

@kirtangajjar

Description

@kirtangajjar

When we set an Incorrect cloudflare API key, we get a fatal error. This error should've been caught by EE and displayed a sensible message to user.

ee config set cloudflare-api-key blah
ee site ssl-renew example.com
Starting SSL cert renewal
PHP Fatal error:  Uncaught GuzzleHttp\Exception\ClientException: Client error: `GET https://api.cloudflare.com/client/v4/zones?page=1&per_page=1000&match=all` resulted in a `403 Forbidden` response:
{"success":false,"errors":[{"code":9103,"message":"Unknown X-Auth-Key or X-Auth-Email"}],"messages":[],"result":null}
 in phar:///usr/local/bin/ee/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 phar:///usr/local/bin/ee/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 phar:///usr/local/bin/ee/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 phar:///usr/local/bin/ee/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 phar:///usr/local/bin/ee/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleH in phar:///usr/local/bin/ee/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113
Warning: An Error occurred. Initiating clean-up.
Warning: Exiting gracefully after rolling back. This may take some time.
Success: Rollback complete. Exiting now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions