diff --git a/src/main/ipcEvent/api.js b/src/main/ipcEvent/api.js index c86855b..2a63bbb 100644 --- a/src/main/ipcEvent/api.js +++ b/src/main/ipcEvent/api.js @@ -2,7 +2,11 @@ import musicAPI from 'music-api' export default { async on (mainWindow, {op, vendor, query}) { - let data = await musicAPI[op](vendor, query) - mainWindow.webContents.send(op, data) + try { + let data = await musicAPI[op](vendor, query) + mainWindow.webContents.send(op, data) + } catch (e) { + mainWindow.webContents.send(op, e) + } } } diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 1775d1a..556dfc8 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -5,7 +5,12 @@