(1138) - Fixed HTTPResponseError with correct constructor and usage (#1666)

Co-authored-by: Dhananjay Agrawal <dhananjay.agrawal@aexp.com>
This commit is contained in:
dhananjaysa92 2022-10-30 16:17:53 -04:00 committed by GitHub
parent 6f72caa401
commit c071406e19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -269,8 +269,8 @@ It is common to create a helper function to check that the response contains no
import fetch from 'node-fetch';
class HTTPResponseError extends Error {
constructor(response, ...args) {
super(`HTTP Error Response: ${response.status} ${response.statusText}`, ...args);
constructor(response) {
super(`HTTP Error Response: ${response.status} ${response.statusText}`);
this.response = response;
}
}