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

feat: better error message for network error #6239

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nodonisko
Copy link

@Nodonisko Nodonisko commented Apr 18, 2024

What's the problem this PR addresses?

This is very minor change to some edge cases of reporting network errors. I added little bit of basic information like response code, method and full url.

Background

Recently plugin yarn oudated took down URL that was used internally, which caused yarn to throw very cryptic error message The remote server failed to provide the requested resource. Due to some caching probably it was very hard to reproduce this locally and even on some of our CIs this worked and on some this failed.

After many hours of debugging we finally tracked down issue, upgraded plugin and it was solved, but I believe error reporting for failed network request should include at least some basic information that will help users debug in future.

Before
Screenshot 2024-04-18 at 15 42 27

After
Screenshot 2024-04-18 at 15 42 10

Reproduction
Add following plugin to .yarnrc.yml

plugins:
  - path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
    spec: "https://mskelton.dev/yarn-outdated/v3"

...

How did you fix it?
I added little bit of basic information like response code, method and full url.

...

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant