title: Display observable error message to our user
body: <p>I have the following method in Login.ts</p>
  
  <pre><code>login(form) {
    this.authService.login(form.value).subscribe(
    result =&gt; { // your result from observer.next() in auth.service
      // success
      this.router.navigateByUrl('tabs');
    },
    error =&gt; { // your error from observer.error() in auth.servi
      // I wish to display my error message here
  );
  } 
  </code></pre>
  
  <p>And this calls the following method in authService.ts </p>
  
  <pre><code> login(postData: User): Observable&lt;any&gt; {
  this.presentLoading('Attempting to Login');
  return new Observable(observer =&gt; {
    this.http.post(this.AUTH_SERVER_ADDRESS + `/login`, postData)
      .pipe(
        catchError(error =&gt; {
          this.loadingController.dismiss();
          return throwError(error); // if you catch any errors, pass them (rethrow) to the error block
        })
       )
       .subscribe(
         result =&gt; {
          this.loadingController.dismiss();
          this.UserIsAuthenticated = true;
          this.setUserID(postData);
          observer.next(result); // if you receive a result, pass to register function in register.page.ts
          observer.complete(); // close the observable
         },
         error =&gt; {
          this.loadingController.dismiss();
          alert(error);
          observer.error(error); // if you receive an error, pass error to register function
          observer.complete(); // close the observable
          }
        );
      });
  
  }
  </code></pre>
  
  <p>If an error occurs in the login method i would like to notify the user with an alert with a detailed description of the error. However i am unsure on how to display this message to the user in the Login.ts file in die are i have indicated with my comments. I have tried </p>
  
  <pre><code>alert(error);
  </code></pre>
  
  <p>which simply returns null as well as </p>
  
  <pre><code>alert(error.value);
  </code></pre>
  
  <p>but neither of these work properly. Any advice on how to achieve this. </p>