fix logging
This commit is contained in:
parent
3875d3cefe
commit
542136dc46
2 changed files with 7 additions and 2 deletions
|
@ -1,5 +1,10 @@
|
|||
import { contextBridge, ipcRenderer } from "electron";
|
||||
|
||||
/* Log errors */
|
||||
ipcRenderer.on("error", (_, err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
/* Context bridge */
|
||||
contextBridge.exposeInMainWorld("internals", {
|
||||
argv: () => ipcRenderer.invoke("argv"),
|
||||
|
|
|
@ -18,9 +18,9 @@ export const getVideoDuration = (file: string) => {
|
|||
};
|
||||
|
||||
/** Print an error to the console and open the dev tool panel */
|
||||
export const printAndDevTool = (win: BrowserWindow, error: string) => {
|
||||
console.error(error);
|
||||
export const printAndDevTool = (win: BrowserWindow, err: string) => {
|
||||
win.webContents.openDevTools();
|
||||
win.webContents.send("error", err);
|
||||
};
|
||||
|
||||
/** Run a command asynchronously */
|
||||
|
|
Loading…
Reference in a new issue