Repository URL to install this package:
|
Version:
3.12.2 ▾
|
import NetworkError from '@filerobot/utils/lib/NetworkError';
/**
* Wrapper around window.fetch that throws a NetworkError when appropriate
*/
export default function fetchWithNetworkError() {
return fetch.apply(void 0, arguments)["catch"](function (err) {
if (err.name === 'AbortError') {
throw err;
} else {
throw new NetworkError(err);
}
});
}