diff --git a/electron-projects/ucap-webmessenger-electron/src/index.ts b/electron-projects/ucap-webmessenger-electron/src/index.ts index 2784fe61..ad714b2f 100644 --- a/electron-projects/ucap-webmessenger-electron/src/index.ts +++ b/electron-projects/ucap-webmessenger-electron/src/index.ts @@ -7,7 +7,8 @@ import { shell, dialog, BrowserWindow, - clipboard + clipboard, + crashReporter } from 'electron'; import path from 'path'; import fse from 'fs-extra'; @@ -133,6 +134,12 @@ function getUptimeInSeconds() { return (now() - launchTime) / 1000; } +crashReporter.start({ + productName: app.name, + companyName: app.getVersion(), + submitURL: 'https//localhost' +}); + process.on('uncaughtException', (error: Error) => { // error = withSourceMappedStack(error); // reportError(error, getExtraErrorContext()); @@ -212,6 +219,7 @@ function createWindow() { } window.onClose(() => { + process.crash(); appWindow = null; if (!__DARWIN__ && !preventQuit) { app.quit(); @@ -671,9 +679,18 @@ ipcMain.on( properties: ['openDirectory'] }) .then(value => { - event.returnValue = value.filePaths[0]; + if (!!value) { + event.returnValue = value.filePaths[0]; + } else { + log.error( + '[IpcMain / SelectDirectory]', + 'Value is null or undefined' + ); + event.returnValue = undefined; + } }) .catch(reason => { + log.error('[IpcMain / SelectDirectory]', reason); event.returnValue = undefined; }); } diff --git a/projects/ucap-webmessenger-ui-settings/src/lib/components/chat.component.ts b/projects/ucap-webmessenger-ui-settings/src/lib/components/chat.component.ts index 410ef913..e71f9d0c 100644 --- a/projects/ucap-webmessenger-ui-settings/src/lib/components/chat.component.ts +++ b/projects/ucap-webmessenger-ui-settings/src/lib/components/chat.component.ts @@ -62,7 +62,9 @@ export class ChatComponent implements OnInit { this.emit({ ...this.setting, downloadPath: path }); } }) - .catch(reason => {}); + .catch(reason => { + this.nativeService.appLogging(reason); + }); } private emit(setting: ChatSetting) {