DJJob.php
public function finishWithError($error, $handler = null) {
        $this->runUpdate("
            UPDATE " . self::$jobsTable . "
            SET attempts = attempts + 1,
                failed_at = IF(attempts >= ?, NOW(), NULL),
                error = IF(attempts >= ?, ?, NULL)
            WHERE id = ?",
            array(
                $this->max_attempts,
                $this->max_attempts,
                $error,
                $this->job_id
            )
        );
        $this->log($error, self::ERROR);
        $this->log("[JOB] failure in job::{$this->job_id}", self::ERROR);
        $this->releaseLock();

        if ($handler && ($this->getAttempts() == $this->max_attempts) && method_exists($handler, '_onDjjobRetryError')) {
          $handler->_onDjjobRetryError($error);
        }
    }
public function finishWithError($error, $handler = null) {
        $this->runUpdate("
            UPDATE " . self::$jobsTable . "
            SET attempts = attempts + 1,
                failed_at = IF(attempts >= ?, NOW(), NULL),
                error = IF(attempts >= ?, ?, NULL)
            WHERE id = ?",
            array(
                $this->max_attempts,
                $this->max_attempts,
                $error,
                $this->job_id
            )
        );
        $this->log($error, self::ERROR);
        $this->log("[JOB] failure in job::{$this->job_id}", self::ERROR);
        $this->releaseLock();

        if ($handler && ($this->getAttempts() == $this->max_attempts) && method_exists($handler, '_onDjjobRetryError')) {
          $handler->_onDjjobRetryError($error);
        }
    }
public function finishWithError ( $ error , $ handler = null ) { $ this -> runUpdate ( "
            UPDATE " . self :: $ jobsTable . "
            SET attempts = attempts + 1,
                failed_at = IF(attempts >= ?, NOW(), NULL),
                error = IF(attempts >= ?, ?, NULL)
            WHERE id = ?" , array ( $ this -> max_attempts , $ this -> max_attempts , $ error , $ this -> job_id ) ) ; $ this -> log ( $ error , self :: ERROR ) ; $ this -> log ( "[JOB] failure in job::{$this->job_id}" , self :: ERROR ) ; $ this -> releaseLock ( ) ; if ( $ handler && ( $ this -> getAttempts ( ) == $ this -> max_attempts ) && method_exists ( $ handler , '_onDjjobRetryError' ) ) { $ handler -> _onDjjobRetryError ( $ error ) ; } }
Finishes this job, but with an error. Keeps the job in the jobs table.

@param string $error The error message to write to the job.
@param null|object $handler The handler that ran this job.
Finishes this job but with an error . Keeps the job in the jobs table .