MCPcopy
hub / github.com/jgraph/drawio-desktop / notifyUpdateFailure

Function notifyUpdateFailure

src/main/electron.js:88–114  ·  view source on GitHub ↗
(err, context)

Source from the content-addressed store, hash-verified

86// Deduped within a short window so a single underlying failure (which can fan out into
87// both a sync throw and an 'error' event) doesn't produce stacked dialogs.
88function notifyUpdateFailure(err, context)
89{
90 manualUpdateCheck = false;
91
92 try { log.error('Update failure (' + (context || 'unknown') + '):', err); }
93 catch (e) { /* swallow logger errors */ }
94
95 if (updateFailureDialogShown) return;
96 updateFailureDialogShown = true;
97 setTimeout(() => { updateFailureDialogShown = false; }, 5000);
98
99 try
100 {
101 dialog.showMessageBox(
102 {
103 type: 'error',
104 title: 'Update Error',
105 message: 'There was a problem updating draw.io.',
106 detail: 'Please manually download and update from ' + UPDATE_DOWNLOAD_URL
107 });
108 }
109 catch (dialogErr)
110 {
111 try { log.error('Failed to show update error dialog:', dialogErr); }
112 catch (e) { /* swallow */ }
113 }
114}
115
116// Invokes an autoUpdater method, catching synchronous throws (e.g. NPEs deep inside
117// electron-updater) and unhandled promise rejections, routing both to the fallback dialog.

Callers 4

safeUpdaterCallFunction · 0.85
safeUpdaterListenerFunction · 0.85
electron.jsFile · 0.85
reportUpdateErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected