(response: Response)
| 220 | } |
| 221 | |
| 222 | parseResponse(response: Response) { |
| 223 | const contentType = response.headers.get('Content-Type'); |
| 224 | if (contentType && contentType.match(/json/)) { |
| 225 | return this.parseJsonResponse(response); |
| 226 | } |
| 227 | const textPromise = response.text().then(text => { |
| 228 | if (!response.ok) { |
| 229 | return Promise.reject(text); |
| 230 | } |
| 231 | return text; |
| 232 | }); |
| 233 | return textPromise; |
| 234 | } |
| 235 | |
| 236 | handleRequestError(error: FetchError, responseStatus: number) { |
| 237 | throw new APIError(error.message, responseStatus, API_NAME); |
no test coverage detected