title: Angular 4+. How can a service http method call itself again with another input value?
body: <p>How can a service http method call itself again with another input value when there was an error while calling this method at first time? Are there better ways to do this?</p>
  
  <pre><code>private subscribedMethod: Subscription;
  
  public someMethod(): void {
      this.subscribedMethod = this.someService.update("first value") // call a service method with "first value"
          .subscribe(
              (data: any) =&gt; {
                  if (data) {
                      // do something
                  }
              },
              (err: any) =&gt; {
                  if (err.status === 404) {
                      this.subscribedMethod.unsubscribe();
                      this.someService.update("second value") // call the same service method with "second value"
                          .subscribe(
                              (data: any) =&gt; {
                                  if (data) {
                                      // do something
                                  }
                          });
                  }
              });
  }
  </code></pre>