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-images.js +15 -2 3.2.1 → 3.2.2 View file →
@@ -7,8 +7,9 @@
7 7 setStatus,
8 8 } from '@auto-launch/functions/helpers';
9 9 import { launchStrings } from '@auto-launch/strings';
10 10 import { IMAGES_HOST } from '@constants';
11 +import { digest } from '@shared/api/digest';
11 12 import { reqDataBasics } from '@shared/lib/data';
12 13
13 14 const fallback = { siteImages: { hero: [], general: [] } };
14 15 const url = `${IMAGES_HOST}/api/images`;
@@ -40,11 +41,23 @@
40 41 });
41 42
42 43 const response = await retryTwice(() =>
43 44 fetchWithTimeout(url, { method, headers, body }),
44 - );
45 + ).catch((error) => {
46 + return { ok: false, statusText: error.message, status: 0 };
47 + });
45 48
46 - if (!response?.ok) return { siteImages: asSections(seeded) };
49 + if (!response?.ok) {
50 + digest({
51 + error: {
52 + message: response.statusText,
53 + name: 'FetchError',
54 + status: response.status,
55 + },
56 + details: { source: 'auto-launch', caller: 'handleSiteImages' },
57 + });
58 + return { siteImages: asSections(seeded) };
59 + }
47 60
48 61 const { siteImages: found } = await failWithFallback(
49 62 async () => {
50 63 const { images } = await response.json();