Error.php
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
* QcloudApi_Common_Error
*/
class QcloudApi_Common_Error
{
/**
* LOCAL_ERROR_CODE
*/
const LOCAL_ERROR_CODE = 3000;
/**
* RESOURCE_PARTLY_FAILED
*/
const RESOURCE_PARTLY_FAILED = 5400;
/**
* $_code
* 错误号
*/
protected $_code;
/**
* $_message
* 错误信息
*/
protected $_message;
/**
* $_ext
* 扩展信息
*/
protected $_ext;
/**
* __construct
* @param int $code 错误号
* @param string $message 错误信息
* @param string $ext 扩展信息
*/
public function __construct($code, $message, $ext = '')
{
$code = (int) $code;
$this->_code = $code ? $code : self::LOCAL_ERROR_CODE;
$this->_message = $message;
$this->_ext = $ext;
}
/**
* getCode
* 获取错误号
*/
public function getCode()
{
return $this->_code;
}
/**
* getMessage
* 获取错误信息
*/
public function getMessage()
{
return $this->_message;
}
/**
* getExt
* 获取扩展信息
*/
public function getExt()
{
return $this->_ext;
}
}