mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
remake BsmException
This commit is contained in:
@@ -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,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,5 +1,4 @@
|
||||
export interface BsmException {
|
||||
type: "error"|"warning"
|
||||
title: string,
|
||||
msg?: string,
|
||||
error?: Error,
|
||||
}
|
||||
Reference in New Issue
Block a user