初始化仓库
This commit is contained in:
35
vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php
vendored
Normal file
35
vendor/qiniu/php-sdk/src/Qiniu/Http/Error.php
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace Qiniu\Http;
|
||||
|
||||
/**
|
||||
* 七牛业务请求逻辑错误封装类,主要用来解析API请求返回如下的内容:
|
||||
* <pre>
|
||||
* {"error" : "detailed error message"}
|
||||
* </pre>
|
||||
*/
|
||||
final class Error
|
||||
{
|
||||
private $url;
|
||||
private $response;
|
||||
|
||||
public function __construct($url, $response)
|
||||
{
|
||||
$this->url = $url;
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
public function code()
|
||||
{
|
||||
return $this->response->statusCode;
|
||||
}
|
||||
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
public function message()
|
||||
{
|
||||
return $this->response->error;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user