로깅 보완
This commit is contained in:
parent
30c0013cc0
commit
f1e789cbb6
|
@ -7,7 +7,8 @@ import {
|
||||||
shell,
|
shell,
|
||||||
dialog,
|
dialog,
|
||||||
BrowserWindow,
|
BrowserWindow,
|
||||||
clipboard
|
clipboard,
|
||||||
|
crashReporter
|
||||||
} from 'electron';
|
} from 'electron';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fse from 'fs-extra';
|
import fse from 'fs-extra';
|
||||||
|
@ -133,6 +134,12 @@ function getUptimeInSeconds() {
|
||||||
return (now() - launchTime) / 1000;
|
return (now() - launchTime) / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
crashReporter.start({
|
||||||
|
productName: app.name,
|
||||||
|
companyName: app.getVersion(),
|
||||||
|
submitURL: 'https//localhost'
|
||||||
|
});
|
||||||
|
|
||||||
process.on('uncaughtException', (error: Error) => {
|
process.on('uncaughtException', (error: Error) => {
|
||||||
// error = withSourceMappedStack(error);
|
// error = withSourceMappedStack(error);
|
||||||
// reportError(error, getExtraErrorContext());
|
// reportError(error, getExtraErrorContext());
|
||||||
|
@ -212,6 +219,7 @@ function createWindow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onClose(() => {
|
window.onClose(() => {
|
||||||
|
process.crash();
|
||||||
appWindow = null;
|
appWindow = null;
|
||||||
if (!__DARWIN__ && !preventQuit) {
|
if (!__DARWIN__ && !preventQuit) {
|
||||||
app.quit();
|
app.quit();
|
||||||
|
@ -671,9 +679,18 @@ ipcMain.on(
|
||||||
properties: ['openDirectory']
|
properties: ['openDirectory']
|
||||||
})
|
})
|
||||||
.then(value => {
|
.then(value => {
|
||||||
|
if (!!value) {
|
||||||
event.returnValue = value.filePaths[0];
|
event.returnValue = value.filePaths[0];
|
||||||
|
} else {
|
||||||
|
log.error(
|
||||||
|
'[IpcMain / SelectDirectory]',
|
||||||
|
'Value is null or undefined'
|
||||||
|
);
|
||||||
|
event.returnValue = undefined;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(reason => {
|
.catch(reason => {
|
||||||
|
log.error('[IpcMain / SelectDirectory]', reason);
|
||||||
event.returnValue = undefined;
|
event.returnValue = undefined;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,9 @@ export class ChatComponent implements OnInit {
|
||||||
this.emit({ ...this.setting, downloadPath: path });
|
this.emit({ ...this.setting, downloadPath: path });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(reason => {});
|
.catch(reason => {
|
||||||
|
this.nativeService.appLogging(reason);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private emit(setting: ChatSetting) {
|
private emit(setting: ChatSetting) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user