Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CronJobException.php
Go to the documentation of this file.
1 <?php
12 
14 {
18  private $exception;
19 
23  public function __construct(\Throwable $exception = null)
24  {
25  $this->exception = $exception;
26  }
27 
31  public function execute()
32  {
33  if (!$this->exception) {
34  $this->exception = new \Exception('Test exception');
35  }
36  throw $this->exception;
37  }
38 }