Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

offline error handling for gatsby new #20571

Closed
m-allanson opened this issue Jan 13, 2020 · 0 comments
Closed

offline error handling for gatsby new #20571

m-allanson opened this issue Jan 13, 2020 · 0 comments
Assignees
Labels
type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change

Comments

@m-allanson
Copy link
Contributor

Summary

Improve error handling for gatsby new when there are network problems.

Basic example

Disable your internet and run gatsby new. You'll see output like:

gatsby new
✔ What is your project called? … something-new
✔ What starter would you like to use? › gatsby-starter-default
info Creating new site from git:
Cloning into 'something-new'...
fatal: unable to access 'https://github.com/gatsbyjs/gatsby-starter-default.git/': Could not resolve host: github.com

 ERROR

Command failed with exit code 128: git clone https://github.com/gatsbyjs/gatsby-starter-default.git something-new --depth=1



  Error: Command failed with exit code 128: git clone https://github.com/gatsbyj  s/gatsby-starter-default.git something-new --depth=1

  - error.js:56 makeError
    [lib]/[gatsby-cli]/[execa]/lib/error.js:56:11

  - index.js:114 handlePromise
    [lib]/[gatsby-cli]/[execa]/index.js:114:26

  - next_tick.js:68 process._tickCallback
    internal/process/next_tick.js:68:7

This error message should be replaced with something that better explains the problem. e.g:

gatsby new failed to download the starter from <url>. This may happen if you're offline or behind a firewall. Visit <docs-url> for troubleshooting tips.

Motivation

Error messages should try and explain the problem and how to fix it.

@LekoArts LekoArts self-assigned this Jan 13, 2020
@danabrit danabrit added topic: reporter type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change labels May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

No branches or pull requests

3 participants