1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Electron: Fixes #247: Unreadable error messages when checking for updates

This commit is contained in:
Laurent Cozic
2018-02-20 18:07:31 +00:00
parent 6bb3184a72
commit 4a56c76901

View File

@ -46,7 +46,13 @@ function onCheckEnded() {
autoUpdater.on('error', (error) => { autoUpdater.on('error', (error) => {
autoUpdateLogger_.error(error); autoUpdateLogger_.error(error);
if (checkInBackground_) return onCheckEnded(); if (checkInBackground_) return onCheckEnded();
showErrorMessageBox(error == null ? "unknown" : (error.stack || error).toString())
let msg = error == null ? "unknown" : (error.stack || error).toString();
// Error messages can be very long even without stack trace so shorten
// then so that the dialog box doesn't take the whole screen.
msg = msg.substr(0,512).replace(/\\n/g, '\n');
showErrorMessageBox(msg)
onCheckEnded(); onCheckEnded();
}) })