Angular 2 HTTP get handling 404 error
<p>I have a service which served an empty json, but i am getting these errors. If i use <a href="https://jsonplaceholder.typicode.com/posts/6" rel="noreferrer">https://jsonplaceholder.typicode.com/posts/6</a> then its ok. How can i handle these errors in the correct way?</p>

<p>Service:</p>

<pre><code>constructor( private http:Http ) { }

fetchData(){
  return this.http.get('https://jsonplaceholder.typicode.com/psts/6')
      .map(
          (res) =&gt; res.json()
      )
      .subscribe(
        (data) =&gt; console.log(data)
  );
}
</code></pre>

<p>Error:</p>

<p><a href="https://i.stack.imgur.com/NGNS9.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/NGNS9.jpg" alt="enter image description here"></a></p>