onError(error) {
    if (this._hasFailed) {
      return;
    }
    this._hasFailed = true;

    if (this._observer) {
      if (this._observer.onError) {
        this._observer.onError(error);
      } else {
        console.log(error);
      }
    } else {
      this._error = error;
    }
  }
/**
   * Will be called on errors.
   * If user-provided observer is present, pass the error
   * to it's onError method, otherwise set instance variable _error.
   * @param {Object} error - An error object
   */
Will be called on errors.
If user-provided observer is present, pass the error
to it's onError method, otherwise set instance variable _error.
@param {Object} error - An error object
Will be called on errors . If user - provided observer is present pass the error to it ' s onError method otherwise set instance variable _error . @param { Object } error - An error object
onError(error) {
    if (this._hasFailed) {
      return;
    }
    this._hasFailed = true;
    if (this._observer) {
      if (this._observer.onError) {
        this._observer.onError(error);
      } else {
        console.log(error);
      }
    } else {
      this._error = error;
    }
  }
onError ( error ) { if ( this . _hasFailed ) { return ; } this . _hasFailed = true ; if ( this . _observer ) { if ( this . _observer . onError ) { this . _observer . onError ( error ) ; } else { console . log ( error ) ; } } else { this . _error = error ; } }
Will be called on errors.
Will be called on errors .