Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 150
Zeile 38... Zeile 38...
38
    }
38
    }
Zeile 39... Zeile 39...
39
 
39
 
40
    /**
40
    /**
41
     * Fail the job from the queue.
41
     * Fail the job from the queue.
42
     *
42
     *
43
     * @param  \Throwable|null  $exception
43
     * @param  \Throwable|string|null  $exception
44
     * @return void
44
     * @return void
45
     */
45
     */
46
    public function fail($exception = null)
46
    public function fail($exception = null)
-
 
47
    {
-
 
48
        if (is_string($exception)) {
-
 
49
            $exception = new ManuallyFailedException($exception);
-
 
50
        }
47
    {
51
 
48
        if ($exception instanceof Throwable || is_null($exception)) {
52
        if ($exception instanceof Throwable || is_null($exception)) {
49
            if ($this->job) {
53
            if ($this->job) {
50
                return $this->job->fail($exception);
54
                return $this->job->fail($exception);
51
            }
55
            }
52
        } else {
56
        } else {
53
            throw new InvalidArgumentException('The fail method requires an instance of Throwable.');
57
            throw new InvalidArgumentException('The fail method requires a string or an instance of Throwable.');
54
        }
58
        }
Zeile 55... Zeile 59...
55
    }
59
    }
56
 
60