roots / trellis-cli

A CLI to manage Trellis projects
https://roots.io/trellis/
MIT License
168 stars 24 forks source link

Bug: Error message when rate limited from GitHub should be improved #309

Closed retlehs closed 2 years ago

retlehs commented 2 years ago

Description

What's wrong?

When temporarily rate limited from the GitHub API, it's possible that trellis new will fail

Steps To Reproduce

  1. Get yourself rate limited (maybe do several composer install's on a project?)
  2. Run trellis new

Expected Behavior

See an error message that makes it obvious what is occurring

Actual Behavior

~/Sites ❯❯❯ trellis new example.com
Creating new Trellis project in /Users/ben/Sites/example.com

Site domain [example.com]:

✔ example.com
Aborting: error while downloading Trellis
Error deleting the temporary archive path: Could not download file : Get "": unsupported protocol scheme ""
This might just be a network error. Please delete this project folder and try again.

When manually visiting https://api.github.com/repos/roots/trellis/releases/latest (you must know this URL since it's not provided in the error), a more helpful error message is returned:

API rate limit exceeded for 1.2.3.4. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)