title: RxJS how to ignore an error with catch and keep going
body: <p>Hi I have the following code and I would like to know how to prevent the main (upstream) Observable from getting deleted when an error is thrown.</p>
  
  <p>How can I change the following code so that all numbers expect '4' get displayed?</p>
  
  <p>I am looking for a general pattern solution that would work in other cases with different operators. This is the simplest case I could come up with.</p>
  
  <pre><code>const Rx = require('rxjs/Rx');
  
  function checkValue(n) {
    if(n === 4) {
      throw new Error("Bad value");
    }
    return true;
  }
  const source = Rx.Observable.interval(100).take(10);
  
  source.filter(x =&gt; checkValue(x))
    .catch(err =&gt; Rx.Observable.empty())
    .subscribe(v =&gt; console.log(v));
  </code></pre>