| 1 |
<?php |
| 2 |
/** |
| 3 |
* Extends MainWP Exception |
| 4 |
* |
| 5 |
* Grabs $extra and stores it in $messageExtra. |
| 6 |
* |
| 7 |
* @package MainWP/Dashboard |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace MainWP\Dashboard; |
| 11 |
|
| 12 |
/** |
| 13 |
* Class MainWP_Exception |
| 14 |
* |
| 15 |
* @package MainWP\Dashboard |
| 16 |
*/ |
| 17 |
class MainWP_Exception extends \Exception { |
| 18 |
|
| 19 |
|
| 20 |
/** |
| 21 |
* Protected variable to hold the extra messages. |
| 22 |
* |
| 23 |
* @var string Error messages. |
| 24 |
*/ |
| 25 |
protected $messageExtra; |
| 26 |
|
| 27 |
|
| 28 |
/** |
| 29 |
* MainWP_Exception constructor. |
| 30 |
* |
| 31 |
* Grab Exception Message upon creation of the object. |
| 32 |
* |
| 33 |
* @param mixed $message Exception message. |
| 34 |
* @param null $extra Any HTTP Errors. |
| 35 |
*/ |
| 36 |
public function __construct( $message, $extra = null ) { |
| 37 |
parent::__construct( $message ); |
| 38 |
$this->messageExtra = esc_html( $extra ); // add more secure. |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* Method get_message_extra() |
| 43 |
* |
| 44 |
* @return $messageExtra Extra messages. |
| 45 |
*/ |
| 46 |
public function get_message_extra() { |
| 47 |
return $this->messageExtra; |
| 48 |
} |
| 49 |
|
| 50 |
} |
| 51 |
|