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