fix: not properly log errors from services

This commit is contained in:
tiddlygit-test 2021-05-01 19:05:43 +08:00
parent 21c9894fb9
commit ea7fb46337
12 changed files with 153 additions and 110 deletions

View file

@ -124,7 +124,7 @@ export class WorkspaceView implements IWorkspaceViewService {
);
}
public async createWorkspaceView(workspaceOptions: INewWorkspaceConfig): Promise<void> {
public async createWorkspaceView(workspaceOptions: INewWorkspaceConfig): Promise<IWorkspace> {
const newWorkspace = await this.workspaceService.create(workspaceOptions);
const mainWindow = this.windowService.get(WindowNames.main);
if (mainWindow !== undefined) {
@ -138,6 +138,7 @@ export class WorkspaceView implements IWorkspaceViewService {
if (typeof workspaceOptions.picturePath === 'string') {
await this.workspaceService.setWorkspacePicture(newWorkspace.id, workspaceOptions.picturePath);
}
return newWorkspace;
}
public async setWorkspaceView(id: string, workspaceOptions: IWorkspace): Promise<void> {

View file

@ -7,7 +7,7 @@ import { IWorkspace, INewWorkspaceConfig } from '@services/workspaces/interface'
* Deal with operations that needs to create a workspace and a browserView at once
*/
export interface IWorkspaceViewService {
createWorkspaceView(workspaceOptions: INewWorkspaceConfig): Promise<void>;
createWorkspaceView(workspaceOptions: INewWorkspaceConfig): Promise<IWorkspace>;
initializeAllWorkspaceView(): Promise<void>;
setWorkspaceView(id: string, workspaceOptions: IWorkspace): Promise<void>;
setWorkspaceViews(workspaces: Record<string, IWorkspace>): Promise<void>;