|
|
@@ -19,6 +19,10 @@ class WebClientFetch {
|
|
|
fetchOptions.body = options.body;
|
|
|
}
|
|
|
const res = yield fetch(options.url, fetchOptions);
|
|
|
+ if (!res.ok) {
|
|
|
+ console.error('HTTP error', res);
|
|
|
+ throw new Error('Error ' + res.status + ' returned from ' + options.url);
|
|
|
+ }
|
|
|
// console.log('res', res);
|
|
|
return res.text();
|
|
|
});
|
|
|
@@ -46,6 +50,10 @@ class WebClientFetch {
|
|
|
fetchOptions.body = options.body;
|
|
|
}
|
|
|
const res = yield fetch(options.url, fetchOptions);
|
|
|
+ if (!res.ok) {
|
|
|
+ console.error('HTTP error', res);
|
|
|
+ throw new Error('Error ' + res.status + ' returned from ' + options.url);
|
|
|
+ }
|
|
|
// console.log('res', res);
|
|
|
return res.json();
|
|
|
});
|