forked from yiisoft/yii2-queue
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInvalidJobException.php
More file actions
48 lines (42 loc) · 1 KB
/
InvalidJobException.php
File metadata and controls
48 lines (42 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yii\queue;
use Exception;
use Throwable;
/**
* Invalid Job Exception.
*
* Throws when serialized message cannot be unserialized to a job.
*
* @author Roman Zhuravlev <zhuravljov@gmail.com>
* @since 2.1.1
*/
class InvalidJobException extends Exception
{
/**
* @param string $serialized
* @param string $message
* @param int $code
* @param Throwable|null $previous
*/
public function __construct(
private readonly string $serialized,
string $message = '',
int $code = 0,
?Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
}
/**
* @return string of serialized message that cannot be unserialized to a job
*/
final public function getSerialized(): string
{
return $this->serialized;
}
}