* Wrapper around `fetch` that checks the status code * * @param {RequestInfo} url * @param {RequestInit} [init] * @return {Promise }
(url, init)
| 18 | * @return {Promise<Response>} |
| 19 | */ |
| 20 | async fetch(url, init) { |
| 21 | const response = await self.fetch(url, init); |
| 22 | if (!response.ok) { |
| 23 | throw new Error(response.statusText); |
| 24 | } |
| 25 | return response; |
| 26 | }, |
| 27 | }; |
no test coverage detected