+ observable.subscribe(
+ (response: any) => {
+ this.processing = false;
+ this.notifService.success('Connect succeeded!');
+ this.dialogRef.close(true);
+ },
+ ( (her: HttpErrorResponse) => {
+ this.processing = false;
+ // the error field carries the server's response
+ let msg = her.message;
+ if (her.error && her.error.message) {
+ msg = her.error.message;
+ }
+ this.errorService.displayError('Connect failed: ' + msg);
+ // keep the dialog open
+ })
+ );