Error handling with Angular2 async pipe : <p>I am using the Angular2 async pipe to stream values into the DOM. Here's a real simple example:</p>

<pre><code>const stream = Observable.interval(1000)
  .take(5)
  .map(n =&gt; { if (n === 3) throw "ERROR"; return n; });

&lt;div *ngFor="for num of stream | async"&gt;
  {{num}}
&lt;/div&gt;

&lt;div id="error"&gt;&lt;/div&gt;
</code></pre>

<p>What I would like to do is to have the sequence of 1-5 displayed, but on the error item (3), somehow populate the <code>#error</code> div with the error message.</p>

<p>This seems to require two things: first is the ability of the Angular async pipe to do something intelligent with errors, which I see no sign of. Looking at the source code, apparently it throws a JS exception, which doesn't seem too friendly.</p>

<p>Second is the ability to restart or continue the sequence after the error. I have read about <code>catch</code> and <code>onErrorResumeNext</code> and so on, but they all involve another sequence which will be switched to on an error. This greatly complicates the logic of generating the stream, on which I would just like to put a series of numbers (in this simple example). I have the sinking feeling that once an error occurs the game is over and the observable is completed and can only be "restarted" with a different observable. I'm still learning observables; is this in fact the case?</p>

<p>So my question is twofold:</p>

<ol>
<li>Can Angular2's async pipe do something intelligent with errors?</li>
<li>Do observables have some simple way to continue after an error?</li>
</ol>
