(err, context)
| 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. |
| 88 | function 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. |
no outgoing calls
no test coverage detected