EasyEngine / EasyEngine/site-command

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

Open
#301 0 comments 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
PHP
Stars
18
Forks
28
PR merge metrics
No merged PRs in 30d

Description

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.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.