PluginProbe
Extendify / 3.2.2
Extendify v3.2.2
3.2.2 3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 All 128 releases
← All changes | src/AutoLaunch/fetchers/get-launch-decisions.js +15 -2 3.1.3 → 3.2.2 View file →
@@ -4,8 +4,9 @@
4 4 fetchWithTimeout,
5 5 retryTwice,
6 6 } from '@auto-launch/functions/helpers';
7 7 import { AI_HOST } from '@constants';
8 +import { digest } from '@shared/api/digest';
8 9 import { reqDataBasics } from '@shared/lib/data';
9 10
10 11 const fallback = {
11 12 launchDecisions: { navExtras: 'none', navButtonLabel: '' },
@@ -18,11 +19,23 @@
18 19 const body = JSON.stringify({ ...reqDataBasics, siteProfile });
19 20
20 21 const response = await retryTwice(() =>
21 22 fetchWithTimeout(url, { method, headers, body }),
22 - );
23 + ).catch((error) => {
24 + return { ok: false, statusText: error.message, status: 0 };
25 + });
23 26
24 - if (!response?.ok) return fallback;
27 + if (!response?.ok) {
28 + digest({
29 + error: {
30 + message: response.statusText,
31 + name: 'FetchError',
32 + status: response.status,
33 + },
34 + details: { source: 'auto-launch', caller: 'handleLaunchDecisions' },
35 + });
36 + return fallback;
37 + }
25 38
26 39 return failWithFallback(
27 40 async () => ({
28 41 launchDecisions: getLaunchDecisionsShape.parse(await response.json()),