react-native-update 10.30.0 → 10.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils.ts +12 -5
package/package.json
CHANGED
package/src/utils.ts
CHANGED
|
@@ -109,9 +109,16 @@ export const enhancedFetch = async (
|
|
|
109
109
|
url: string,
|
|
110
110
|
params: Parameters<typeof fetch>[1],
|
|
111
111
|
) => {
|
|
112
|
-
return fetch(url, params)
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
return fetch(url, params)
|
|
113
|
+
.then(r => {
|
|
114
|
+
if (r.ok) {
|
|
115
|
+
return r;
|
|
116
|
+
}
|
|
117
|
+
throw new Error(`${r.status} ${r.statusText}`);
|
|
118
|
+
})
|
|
119
|
+
.catch(e => {
|
|
120
|
+
log('fetch error', url, e);
|
|
121
|
+
log('trying fallback to http');
|
|
122
|
+
return fetch(url.replace('https', 'http'), params);
|
|
123
|
+
});
|
|
117
124
|
};
|