-
Notifications
You must be signed in to change notification settings - Fork 684
Expand file tree
/
Copy pathMissingAssetException.php
More file actions
71 lines (63 loc) · 1.6 KB
/
MissingAssetException.php
File metadata and controls
71 lines (63 loc) · 1.6 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\errors;
use craft\models\AssetIndexData;
use craft\models\Volume;
use craft\models\VolumeFolder;
use Throwable;
use yii\base\Exception;
/**
* MissingAssetException represents an exception caused by an asset record that doesn't exist.
*
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @since 3.2.0
*/
class MissingAssetException extends Exception
{
/**
* @var AssetIndexData
*/
public AssetIndexData $indexEntry;
/**
* @var Volume
*/
public Volume $volume;
/**
* @var VolumeFolder
*/
public VolumeFolder $folder;
/**
* @var string
*/
public string $filename;
/**
* Constructor
*
* @param AssetIndexData $indexEntry
* @param Volume $volume
* @param VolumeFolder $folder
* @param string $filename
* @param string $message
* @param int $code
* @param Throwable|null $previous
*/
public function __construct(AssetIndexData $indexEntry, Volume $volume, VolumeFolder $folder, string $filename, string $message = '', int $code = 0, ?Throwable $previous = null)
{
$this->indexEntry = $indexEntry;
$this->volume = $volume;
$this->folder = $folder;
$this->filename = $filename;
parent::__construct($message, $code, $previous);
}
/**
* @return string the user-friendly name of this exception
*/
public function getName(): string
{
return 'Missing asset';
}
}