1 2 3 4 5 6 7 8
function responseText(response) { if (!response.ok) throw new Error(response.status + " " + response.statusText); return response.text(); } export default function(input, init) { return fetch(input, init).then(responseText); }