Skip to content

Commit

Permalink
pass msg body to the error
Browse files Browse the repository at this point in the history
  • Loading branch information
spooky-finn committed Mar 14, 2024
1 parent 8da9912 commit c6f8172
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/core/errors.ts
Expand Up @@ -96,7 +96,7 @@ export class HTTPError<T = any> extends RequestError<T> {
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/",
]
}

0 comments on commit c6f8172

Please sign in to comment.