generated from liutk/owl-admin-base
29 lines
590 B
PHP
29 lines
590 B
PHP
<?php
|
|
|
|
namespace App\Exceptions;
|
|
|
|
use Throwable;
|
|
|
|
class RuntimeException extends \RuntimeException
|
|
{
|
|
/**
|
|
* HTTP 响应状态码
|
|
*/
|
|
protected $httpStatusCode = 400;
|
|
|
|
public function __construct(string $message = 'Bad request', int $code = 10000, ?Throwable $previous = null)
|
|
{
|
|
parent::__construct($message, $code, $previous);
|
|
}
|
|
|
|
public function getHttpStatusCode(): int
|
|
{
|
|
return $this->httpStatusCode;
|
|
}
|
|
|
|
public function setHttpStatusCode(int $httpStatusCode): void
|
|
{
|
|
$this->httpStatusCode = $httpStatusCode;
|
|
}
|
|
}
|