25 lines
510 B
PHP
25 lines
510 B
PHP
<?php
|
|
namespace app\common\exception;
|
|
|
|
use Exception;
|
|
use Throwable;
|
|
use Webman\Http\Request;
|
|
use Webman\Http\Response;
|
|
use Webman\Exception\ExceptionHandler;
|
|
|
|
class BusinessException extends Exception
|
|
{
|
|
protected $data;
|
|
|
|
public function __construct(string $message = "", int $code = 400, $data = null, Throwable $previous = null)
|
|
{
|
|
$this->data = $data;
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
|
|
public function getData()
|
|
{
|
|
return $this->data;
|
|
}
|
|
}
|