(response: Response)
| 320 | } |
| 321 | |
| 322 | parseResponse(response: Response) { |
| 323 | const contentType = response.headers.get('Content-Type'); |
| 324 | if (contentType && contentType.match(/json/)) { |
| 325 | return this.parseJsonResponse(response); |
| 326 | } |
| 327 | const textPromise = response.text().then(text => { |
| 328 | if (!response.ok) { |
| 329 | return Promise.reject(text); |
| 330 | } |
| 331 | return text; |
| 332 | }); |
| 333 | return textPromise; |
| 334 | } |
| 335 | |
| 336 | handleRequestError(error: FetchError, responseStatus: number) { |
| 337 | throw new APIError(error.message, responseStatus, API_NAME); |
no test coverage detected