Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
kirtangajjar opened this issue Jan 31, 2019 · 0 comments
Labels
good first issue Good for newcomers

Comments

@kirtangajjar
Copy link
Contributor

kirtangajjar commented Jan 31, 2019

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.
@kirtangajjar kirtangajjar added the good first issue Good for newcomers label Jan 31, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant