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";
|
import { contextBridge, ipcRenderer } from "electron";
|
||||||
|
|
||||||
|
/* Log errors */
|
||||||
|
ipcRenderer.on("error", (_, err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
|
||||||
/* Context bridge */
|
/* Context bridge */
|
||||||
contextBridge.exposeInMainWorld("internals", {
|
contextBridge.exposeInMainWorld("internals", {
|
||||||
argv: () => ipcRenderer.invoke("argv"),
|
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 */
|
/** Print an error to the console and open the dev tool panel */
|
||||||
export const printAndDevTool = (win: BrowserWindow, error: string) => {
|
export const printAndDevTool = (win: BrowserWindow, err: string) => {
|
||||||
console.error(error);
|
|
||||||
win.webContents.openDevTools();
|
win.webContents.openDevTools();
|
||||||
|
win.webContents.send("error", err);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Run a command asynchronously */
|
/** Run a command asynchronously */
|
||||||
|
|
Loading…
Reference in a new issue