Skip to content

Commit

Permalink
feat: better error message for network error
Browse files Browse the repository at this point in the history
  • Loading branch information
Nodonisko committed Apr 18, 2024
1 parent c64644a commit 130385d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .yarn/versions/11826db1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
releases:
"@yarnpkg/core": patch
2 changes: 1 addition & 1 deletion packages/yarnpkg-core/sources/httpUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function prettyNetworkError(response: Promise<Response>, {configuration, c

if (message == null) {
if (err.message.startsWith(`Response code`)) {
message = `The remote server failed to provide the requested resource`;
message = `The remote server failed to provide the requested resource (${err.response?.statusCode} ${err.request?.options?.method} ${err.request?.options?.url?.href})`;
} else {
message = err.message;
}
Expand Down

0 comments on commit 130385d

Please sign in to comment.