remake BsmException

This commit is contained in:
MathieuG-P
2022-07-19 20:51:08 +02:00
parent 0fac3da409
commit 6407fb2ff1
3 changed files with 7 additions and 6 deletions
+3 -2
View File
@@ -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<st
installerService.setInstallationDirectory(request.args).then(res => {
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});
});
})
+3 -2
View File
@@ -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<LauchOption>) => {
const launcherService = BSLauncherService.getInstance();
@@ -10,7 +11,7 @@ ipcMain.on('bs-launch.launch', (event, request: IpcRequest<LauchOption>) => {
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});
})
});
+1 -2
View File
@@ -1,5 +1,4 @@
export interface BsmException {
type: "error"|"warning"
title: string,
msg?: string,
error?: Error,
}