add
This commit is contained in:
22
app/exception/HttpResponseException.php
Normal file
22
app/exception/HttpResponseException.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace app\exception;
|
||||
|
||||
use RuntimeException;
|
||||
use support\Response;
|
||||
|
||||
class HttpResponseException extends RuntimeException
|
||||
{
|
||||
protected $response;
|
||||
|
||||
// 接收 Response 实例作为参数
|
||||
public function __construct(Response $response)
|
||||
{
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
// 获取响应对象
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user