cmbYouku_Api/app/exception/LogicException.php

31 lines
651 B
PHP
Raw Permalink Normal View History

2024-07-01 15:57:07 +08:00
<?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;
}
}