src/Support/Concerns/Retriable.php
function fail($callback) 
  { 
    if (is_null($this->state)) {
      $this->onError[] = $callback;
    } else if (!$this->state) {
      $callback($this->result);
    }
    return $this;
  }
function fail($callback) 
  { 
    if (is_null($this->state)) {
      $this->onError[] = $callback;
    } else if (!$this->state) {
      $callback($this->result);
    }
    return $this;
  }
function fail ( $ callback ) { if ( is_null ( $ this -> state ) ) { $ this -> onError [ ] = $ callback ; } else if ( ! $ this -> state ) { $ callback ( $ this -> result ) ; } return $ this ; }
If the wrapped operation ultimately fails on all attempts,
invoke the given function. Many functions can be
added to the stack. If the attempted execution
of the wrapped operation has already failed, the the function
given here will be invoked instantly.
@param function
@return self
If the wrapped operation ultimately fails on all attempts invoke the given function . Many functions can be added to the stack . If the attempted execution of the wrapped operation has already failed the the function given here will be invoked instantly .