adminforth 2.67.0 → 2.67.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.
|
@@ -149,6 +149,10 @@ export async function callApi({path, method, body, headers, silentError = false,
|
|
|
149
149
|
}
|
|
150
150
|
return await r.json();
|
|
151
151
|
} catch(e) {
|
|
152
|
+
if (e instanceof DOMException && e.name === 'AbortError') {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
|
|
152
156
|
// if it is internal error, say to user
|
|
153
157
|
if (e instanceof TypeError && e.message === 'Failed to fetch') {
|
|
154
158
|
// this is a network error
|
|
@@ -158,7 +162,7 @@ export async function callApi({path, method, body, headers, silentError = false,
|
|
|
158
162
|
return null;
|
|
159
163
|
}
|
|
160
164
|
|
|
161
|
-
if (!silentError
|
|
165
|
+
if (!silentError) {
|
|
162
166
|
adminforth.alert({variant:'danger', message: t('Something went wrong, please try again later'),})
|
|
163
167
|
}
|
|
164
168
|
console.error(`error in callApi ${path}`, e);
|