로깅 보완

This commit is contained in:
leejinho 2020-03-26 14:54:00 +09:00
parent 30c0013cc0
commit f1e789cbb6
2 changed files with 22 additions and 3 deletions

View File

@ -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 => {
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;
});
}

View File

@ -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) {