(response: Response)
| 348 | } |
| 349 | |
| 350 | parseResponse(response: Response) { |
| 351 | const contentType = response.headers.get('Content-Type'); |
| 352 | if (contentType && contentType.match(/json/)) { |
| 353 | return this.parseJsonResponse(response); |
| 354 | } |
| 355 | const textPromise = response.text().then(text => { |
| 356 | if (!response.ok) { |
| 357 | return Promise.reject(text); |
| 358 | } |
| 359 | return text; |
| 360 | }); |
| 361 | return textPromise; |
| 362 | } |
| 363 | |
| 364 | handleRequestError(error: FetchError, responseStatus: number) { |
| 365 | throw new APIError(error.message, responseStatus, API_NAME); |
no test coverage detected