31 lines
		
	
	
		
			651 B
		
	
	
	
		
			PHP
		
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			651 B
		
	
	
	
		
			PHP
		
	
	
	
| <?php
 | |
| declare(strict_types=1);
 | |
| 
 | |
| namespace app\exception;
 | |
| 
 | |
| use app\event\LogicExceptionLog;
 | |
| use Throwable;
 | |
| 
 | |
| /**
 | |
|  * Class LogicException
 | |
|  * @describe Exception
 | |
|  * @package app\exception
 | |
|  */
 | |
| class LogicException extends \LogicException
 | |
| {
 | |
|     protected $data = [];
 | |
|     public function __construct(string $message = "", int $code = 0)
 | |
|     {
 | |
|         !empty($message) && $this->message = $message;
 | |
|         !empty($code) && $this->code = $code;
 | |
|     }
 | |
|     final protected function setData($label, $value): self
 | |
|     {
 | |
|         $this->data[$label] = $value;
 | |
|         return $this;
 | |
|     }
 | |
|     final public function getData()
 | |
|     {
 | |
|         return $this->data;
 | |
|     }
 | |
| } |