1 | <?php |
||
11 | class PublicationFailed extends Exception |
||
12 | { |
||
13 | private const CODE = 8001; |
||
14 | |||
15 | /** |
||
16 | * @var Product |
||
17 | */ |
||
18 | protected Product $product; |
||
|
|||
19 | |||
20 | public static function forProductVersion( |
||
21 | Product $product, |
||
22 | string $version, |
||
23 | Exception $previous = null |
||
24 | ): ExceptionContract { |
||
25 | $message = sprintf('Failed to publish version `%s` of product `%s`.', $version, $product->getName()); |
||
26 | $self = new self($message, self::CODE, $previous); |
||
27 | $self->product = $product; |
||
28 | |||
29 | return $self; |
||
30 | } |
||
31 | } |
||
32 |