Skip to content

Commit

Permalink
Fixes the builds
Browse files Browse the repository at this point in the history
  • Loading branch information
digimezzo committed Nov 3, 2023
1 parent fd8ebb2 commit 76523f7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/app/globalErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ import { BrowserWindow } from 'electron';
import { BaseApplication } from './common/io/base-application';
import { Logger } from './common/logger';
import { ErrorDialogComponent } from './components/dialogs/error-dialog/error-dialog.component';
import { ErrorData } from './services/dialog/error-data';

@Injectable()
export class GlobalErrorHandler implements ErrorHandler {
public constructor(private application: BaseApplication, private logger: Logger, private dialog: MatDialog, private zone: NgZone) {}
public constructor(
private application: BaseApplication,
private logger: Logger,
private dialog: MatDialog,
private zone: NgZone,
) {}

public handleError(e: Error): void {
this.logger.error(e, 'Handling global error', 'GlobalErrorHandler', 'handleError');
Expand All @@ -22,7 +28,7 @@ export class GlobalErrorHandler implements ErrorHandler {
// TranslationService is not able to provide the translation of texts in this class.
// So we use a workaround where the translation happens in the error dialog itself.
width: '450px',
data: { isGlobalError: true },
data: new ErrorData('', true),
});

dialogRef.afterClosed().subscribe(() => {
Expand Down
7 changes: 5 additions & 2 deletions src/app/services/dialog/dialog.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import { PlaylistData } from './playlist-data';

@Injectable()
export class DialogService implements BaseDialogService {
public constructor(private dialog: MatDialog, private playlistModelFactory: PlaylistModelFactory) {}
public constructor(
private dialog: MatDialog,
private playlistModelFactory: PlaylistModelFactory,
) {}

public isInputDialogOpened: boolean = false;

Expand Down Expand Up @@ -54,7 +57,7 @@ export class DialogService implements BaseDialogService {
public showErrorDialog(errorText: string): void {
this.dialog.open(ErrorDialogComponent, {
width: '450px',
data: new ErrorData(errorText),
data: new ErrorData(errorText, false),
});
}

Expand Down
5 changes: 4 additions & 1 deletion src/app/services/dialog/error-data.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export class ErrorData {
public constructor(public errorText: string) {}
public constructor(
public errorText: string,
public isGlobalError: boolean,
) {}
}

0 comments on commit 76523f7

Please sign in to comment.