Show error dialog on server error
This commit is contained in:
parent
dd4eff842c
commit
c27d5623a7
@ -35,7 +35,7 @@ export class EditierenComponent implements OnInit {
|
|||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
private _snackbar: MatSnackBar,
|
private _snackbar: MatSnackBar,
|
||||||
private _logger: NGXLogger,
|
private _logger: NGXLogger,
|
||||||
) {
|
private _dialog: MatDialog) {
|
||||||
this.route.paramMap.subscribe(paramMap => {
|
this.route.paramMap.subscribe(paramMap => {
|
||||||
this.id = paramMap.get('id');
|
this.id = paramMap.get('id');
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
@ -69,7 +69,10 @@ export class EditierenComponent implements OnInit {
|
|||||||
match_all_keywords: data.match_all_keywords
|
match_all_keywords: data.match_all_keywords
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
err => this._logger.error(err),
|
err => {
|
||||||
|
this.errorDialog();
|
||||||
|
this._logger.error(err);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,6 +93,7 @@ export class EditierenComponent implements OnInit {
|
|||||||
this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000});
|
this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000});
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
this.errorDialog();
|
||||||
this._logger.error(err);
|
this._logger.error(err);
|
||||||
return throwError(err);
|
return throwError(err);
|
||||||
}
|
}
|
||||||
@ -100,10 +104,24 @@ export class EditierenComponent implements OnInit {
|
|||||||
this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000});
|
this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000});
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
this.errorDialog();
|
||||||
this._logger.error(err);
|
this._logger.error(err);
|
||||||
return throwError(err);
|
return throwError(err);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public errorDialog() {
|
||||||
|
const dialogRef = this._dialog.open(DialogComponent, {
|
||||||
|
data: {
|
||||||
|
title: 'Serverfehler',
|
||||||
|
body: 'Fehler beim Aufruf des Servers',
|
||||||
|
abort: 'Abbrechen',
|
||||||
|
confirm: 'OK',
|
||||||
|
hideAbort: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,4 +66,17 @@ export class EinstellungenComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public errorDialog() {
|
||||||
|
const dialogRef = this._dialog.open(DialogComponent, {
|
||||||
|
data: {
|
||||||
|
title: 'Serverfehler',
|
||||||
|
body: 'Fehler beim Aufruf des Servers',
|
||||||
|
abort: 'Abbrechen',
|
||||||
|
confirm: 'OK',
|
||||||
|
hideAbort: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user