| 1 | <?php |
||
| 13 | class UploadException extends \RuntimeException |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var bool |
||
| 17 | */ |
||
| 18 | protected $retry = false; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var bool |
||
| 22 | */ |
||
| 23 | protected $disable = false; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | protected $reason; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var CloudStorage |
||
| 32 | */ |
||
| 33 | protected $storage; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var UploadRequest |
||
| 37 | */ |
||
| 38 | protected $request; |
||
| 39 | |||
| 40 | public function __construct(UploadRequest $request, $previous = null) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @param $message |
||
| 48 | * |
||
| 49 | * @return $this |
||
| 50 | */ |
||
| 51 | public function retry( $message ) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @param $message |
||
| 61 | * @param null $reason |
||
| 62 | */ |
||
| 63 | public function disable( $message, $reason = null) |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @return UploadRequest |
||
| 71 | */ |
||
| 72 | public function getRequest() |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @param CloudStorage $storage |
||
| 79 | */ |
||
| 80 | public function setStorage(CloudStorage $storage) |
||
| 84 | |||
| 85 | /** |
||
| 86 | * @return bool |
||
| 87 | */ |
||
| 88 | public function shouldRetry() |
||
| 92 | |||
| 93 | /** |
||
| 94 | * @return bool |
||
| 95 | */ |
||
| 96 | public function shouldDisable() |
||
| 100 | |||
| 101 | /** |
||
| 102 | * @return string |
||
| 103 | */ |
||
| 104 | public function getReason() |
||
| 108 | } |