title: Angular 6 RxJS6 Type 'void' is not assignable to type 'ObservableInput<{}>'
body: <p>I am converting my code to use RxJS6 syntax to use pipe and map but I am getting error. </p>
  
  <pre><code>error TS2345: Argument of type '(error: any) =&gt; void' is not assignable to parameter of type '(err:
  any, caught: Observable&lt;void&gt;) =&gt; ObservableInput&lt;{}&gt;'.
    Type 'void' is not assignable to type 'ObservableInput&lt;{}&gt;'.
  </code></pre>
  
  <p>The existing code works fine but the issue I have is that before result is returned, other methods get called. So to my understanding using pipe and map 
  will resolve this issue.
  Here is the code I had initially:</p>
  
  <pre><code>this._reportingService.GetProjectReportsData(data).subscribe(result =&gt; {
      if (result != null) {
          this.reportData = result;
      }
  
  }, error =&gt; {
      this.ErrorMessage('Unable to load workbook ' + error.toString());
      this._reportingService.isLoading = false;
  });
  </code></pre>
  
  <p>Here is the code I am trying to convert to using pipe and map:</p>
  
  <p>I have imported along with rest of imports</p>
  
  <pre><code>import { Observable, of, throwError } from 'rxjs';
  import { map, catchError, retry } from 'rxjs/operators';
  </code></pre>
  
  <p>and in the method(modified; removed this.error) Please guide how to add code for errorMessage:</p>
  
  <pre><code>this._reportingService.GetProjectReportsData(data).pipe(
      map(result =&gt; {
          if (result != null) {
  
    this.reportData = result;
  
  
          }
      }))
      .subscribe();
  </code></pre>
  
  <p>And my service class:</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Observable } from 'rxjs';
  import { HttpClient, HttpErrorResponse } from '@angular/common/http';
  import { BehaviorSubject } from 'rxjs/BehaviorSubject';
  
  import { map, tap, catchError } from 'rxjs/operators';
  import 'rxjs/add/operator/catch';
  import 'rxjs/add/observable/throw';
  
  
  @Injectable({
      providedIn: 'root'
  })
  export class ReportingService extends BehaviorSubject&lt;any[]&gt;{
  
      constructor(private http: HttpClient) {
  
      super(null);
      }
  
      public GetProjectReportsData(data: any): Observable&lt;any&gt; {
          return this.http.post(this.GetProjectReportDataUrl, data)
              .pipe(map(res =&gt; &lt;any[]&gt;res))
              .pipe(catchError(this.handleError));
      }
      private handleError(error: any) {
  
          let errMsg = (error.message) ? error.message :
              error.status ? `${error.status} - ${error.statusText}` : 'Server error';
          return Observable.throw(errMsg);
      }
  
  }
  </code></pre>