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

fix(create-astro): log fetch errors #11567

Merged
merged 1 commit into from
Jul 29, 2024
Merged

fix(create-astro): log fetch errors #11567

merged 1 commit into from
Jul 29, 2024

Conversation

ascorbic
Copy link
Contributor

Changes

If create-astro fails when downloading a template, it currently only logs something unhelpful like "fetch error". This leads to reports like #11396, which is probably mutliple different issues. This PR changes it to traverse into err.cause to find the underlying error from undici.

Fixes #11396

Testing

Tested by disabling the network after starting the command, which gave "Error: getaddrinfo ENOTFOUND api.github.com"

Docs

Copy link

changeset-bot bot commented Jul 29, 2024

🦋 Changeset detected

Latest commit: 8351343

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: create-astro Related to the `create-astro` package (scope) label Jul 29, 2024
@Princesseuh
Copy link
Member

Any chance you could take a screenshot of what it looks like now vs before?

@ascorbic
Copy link
Contributor Author

Sure! Before:
image
After:
image
The user who reported the issue had an even less helpful one though:
image

@Princesseuh
Copy link
Member

Awesome, thank you! It is a little bit wonky looking, but it's fine with me since there's really a limited amount of errors you can get here.

@ascorbic
Copy link
Contributor Author

From what I can see we don't have any structured errors in create-astro, so logs like that are the best we have

@ascorbic ascorbic merged commit d27cf6d into main Jul 29, 2024
13 checks passed
@ascorbic ascorbic deleted the create-log branch July 29, 2024 12:49
@astrobot-houston astrobot-houston mentioned this pull request Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: create-astro Related to the `create-astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create-astro does not work
2 participants