diff --git a/src/main/ipcs/bs-download-ipcs.ts b/src/main/ipcs/bs-download-ipcs.ts index a870104f..d80f924a 100644 --- a/src/main/ipcs/bs-download-ipcs.ts +++ b/src/main/ipcs/bs-download-ipcs.ts @@ -4,6 +4,7 @@ import { BSInstallerService, DownloadEventType } from '../services/bs-installer. import { IpcRequest } from 'shared/models/ipc'; import { InstallationLocationService } from '../services/installation-location.service'; import { UtilsService } from '../services/utils.service'; +import { BsmException } from 'shared/models/bsm-exception.model'; export interface InitDownloadInfoInterface { @@ -50,9 +51,9 @@ ipcMain.on('bs-download.set-installation-folder', (event, request: IpcRequest { console.log("déplacement terminer"); UtilsService.getInstance().ipcSend(request.responceChannel, {success: true, data: res}); - }).catch(err => { + }).catch((err: BsmException) => { console.log(err); - UtilsService.getInstance().ipcSend(request.responceChannel, {success: false, error: {title: err, type: 'error'}}); + UtilsService.getInstance().ipcSend(request.responceChannel, {success: false, error: err}); }); }) diff --git a/src/main/ipcs/bs-launcher-ipcs.ts b/src/main/ipcs/bs-launcher-ipcs.ts index c0f95581..53ff080a 100644 --- a/src/main/ipcs/bs-launcher-ipcs.ts +++ b/src/main/ipcs/bs-launcher-ipcs.ts @@ -3,6 +3,7 @@ import { UtilsService } from '../services/utils.service' import { LauchOption } from "shared/models/bs-launch"; import { BSLauncherService } from "../services/bs-launcher.service" import { IpcRequest } from 'shared/models/ipc'; +import { BsmException } from 'shared/models/bsm-exception.model'; ipcMain.on('bs-launch.launch', (event, request: IpcRequest) => { const launcherService = BSLauncherService.getInstance(); @@ -10,7 +11,7 @@ ipcMain.on('bs-launch.launch', (event, request: IpcRequest) => { launcherService.launch(request.args).then(res => { utilsService.ipcSend(request.responceChannel, {success: true, data: res}); - }).catch(err => { - utilsService.ipcSend(request.responceChannel, {success: false, error: {title: err, type: 'error'}}); + }).catch((err: BsmException) => { + utilsService.ipcSend(request.responceChannel, {success: false, error: err}); }) }); diff --git a/src/shared/models/bsm-exception.model.ts b/src/shared/models/bsm-exception.model.ts index 0e64d5cc..3b90aad0 100644 --- a/src/shared/models/bsm-exception.model.ts +++ b/src/shared/models/bsm-exception.model.ts @@ -1,5 +1,4 @@ export interface BsmException { - type: "error"|"warning" title: string, - msg?: string, + error?: Error, } \ No newline at end of file