PluginProbe
Extendify / 3.2.3
Extendify v3.2.3
3.2.3 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 All 129 releases
← All changes | src/AutoLaunch/functions/plugins.js +17 -11 3.2.1 → 3.2.3 View file →
@@ -62,9 +62,13 @@
62 62 return await fn();
63 63 } catch (error) {
64 64 digest({
65 65 error,
66 - details: { source: 'auto-launch', caller: 'installPlugin' },
66 + details: {
67 + source: 'auto-launch',
68 + caller: 'installPlugin',
69 + plugin: slug,
70 + },
67 71 });
68 72 return null;
69 73 }
70 74 }
@@ -97,21 +101,23 @@
97 101
98 102 try {
99 103 await fn(slug);
100 104 return true;
101 - } catch (_) {
102 - try {
103 - // try once more but get the slug first
104 - const { plugin } = await getPlugin(slug);
105 - await fn(plugin);
106 - return true;
107 - } catch (error) {
105 + } catch (error) {
106 + const report = (e) => {
108 107 digest({
109 - error,
110 - details: { source: 'auto-launch', caller: 'activatePlugin' },
108 + error: e,
109 + details: {
110 + source: 'auto-launch',
111 + caller: 'activatePlugin',
112 + plugin: slug,
113 + },
111 114 });
112 115 return false;
113 - }
116 + };
117 + const found = await getPlugin(slug).catch(() => undefined);
118 + if (!found?.plugin) return report(error);
119 + return fn(found.plugin).then(() => true, report);
114 120 }
115 121 };
116 122
117 123 // Exact match, not substring: woocommerce-payments would mask a missing woocommerce.