Angular2 : HTTP Observables flow is not clear
<p>In my component i am calling Rest service and want to save the data, The Rest call is not successful(<strong>expected behaviour</strong>) so i was expecting this code to be executed:</p>

<blockquote>
  <p>err => console.log(err) &amp;&amp; this.accessLevel==AccessLevel.DISBLED</p>
</blockquote>

<pre><code>export class CustomerComponent extends SuperChildComponent{
  public static url:string='/orderViewCustomer/';
  public id;
  public allowed: boolean = false;
  public  accessLevel:AccessLevel =null;
  public componentname:string;
  public customerData:Customer=null;

  constructor(private rest:REST,private authenticationService : AuthorizationService) {
    super();
    this.componentname=this.constructor.name;
     this.accessLevel=this.authenticationService.isUserLoggedIn()?this.authenticationService.componentAccessLevel(this.constructor.name):null;
     console.log(this.constructor.name +' has '+this.accessLevel);
     if(this.accessLevel==AccessLevel.ENABLED){
       this.getData();
     }
  }

  private getData():any{
    this.rest.get(CustomerComponent.url,this.id).subscribe(data=&gt; this.storeData(data.json()), err =&gt; console.log(err) &amp;&amp; this.accessLevel==AccessLevel.DISBLED);
  }



private storeData(res:Object):any{
            //TODO
      //this.customerData =&lt;Customer&gt;res;
   this.customerData=&lt;Customer&gt;this.dummy;
}       
</code></pre>

<p>This is the get method from my rest service:</p>

<pre><code>get(resource: string, id: number, params: URLSearchParams = new URLSearchParams()) {
    let headers = this.defaultHeaders;
    headers.set("Authorization", this.authdata);
    return this
        .http
        .get(this.getUrl(resource) + '/' + id, params);
    // .map((r: Response) =&gt; r.json());
}
</code></pre>

<p><strong>but error block is never executed and so does the storeData(dat.json()) function.</strong> </p>

<p>Does subscriber blocks get executed only when call is successful ?</p>

<p>Is there anything i am missing here ?</p>

<p>Thanks</p>