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

pass msg body to the error #2339

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/core/errors.ts
Expand Up @@ -96,7 +96,7 @@
declare readonly timings: Timings;

constructor(response: PlainResponse) {
super(`Response code ${response.statusCode} (${response.statusMessage!})`, {}, response.request);
super(`Response code ${response.statusCode} (${response.statusMessage!}), Body: ${response?.body}`, {}, response.request);

Check failure on line 99 in source/core/errors.ts

View workflow job for this annotation

GitHub Actions / Node.js 20 on macos-latest

Invalid type "unknown" of template literal expression.
this.name = 'HTTPError';
this.code = 'ERR_NON_2XX_3XX_RESPONSE';
}
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Expand Up @@ -13,5 +13,8 @@
"source",
"test",
"benchmark"
],
"exclude": [
"test/",
]
}