Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
error.php
1
<?php
9
namespace
Bitrix\Main
;
10
11
use Throwable;
12
13
class
Error
implements
\JsonSerializable
14
{
16
protected
$code
;
17
19
protected
$message
;
23
protected
$customData
;
24
33
public
function
__construct
(
$message
,
$code
= 0,
$customData
=
null
)
34
{
35
$this->message =
$message
;
36
$this->code =
$code
;
37
$this->customData =
$customData
;
38
}
39
44
public
static
function
createFromThrowable
(Throwable $exception): static
45
{
46
return
new
static
($exception->getMessage(), $exception->getCode());
47
}
48
53
public
function
getCode
()
54
{
55
return
$this->code
;
56
}
57
62
public
function
getMessage
()
63
{
64
return
$this->message
;
65
}
66
70
public
function
getCustomData
()
71
{
72
return
$this->customData
;
73
}
74
75
public
function
__toString
()
76
{
77
return
$this->
getMessage
();
78
}
79
87
#[\ReturnTypeWillChange]
88
public
function
jsonSerialize
()
89
{
90
return
[
91
'message'
=> $this->
getMessage
(),
92
'code'
=> $this->
getCode
(),
93
'customData'
=> $this->
getCustomData
(),
94
];
95
}
96
}
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Error\getMessage
getMessage()
Definition
error.php:62
Bitrix\Main\Error\createFromThrowable
static createFromThrowable(Throwable $exception)
Definition
error.php:44
Bitrix\Main\Error\__toString
__toString()
Definition
error.php:75
Bitrix\Main\Error\$code
$code
Definition
error.php:16
Bitrix\Main\Error\__construct
__construct($message, $code=0, $customData=null)
Definition
error.php:33
Bitrix\Main\Error\getCode
getCode()
Definition
error.php:53
Bitrix\Main\Error\$message
$message
Definition
error.php:19
Bitrix\Main\Error\jsonSerialize
jsonSerialize()
Definition
error.php:88
Bitrix\Main\Error\getCustomData
getCustomData()
Definition
error.php:70
Bitrix\Main\Error\$customData
$customData
Definition
error.php:23
Bitrix\Main
modules
main
lib
error.php
Создано системой
1.10.0