1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
error.php
См. документацию.
1<?php
8
9namespace Bitrix\Main;
10
11use Bitrix\Main\Localization\LocalizableMessageInterface;
12use Throwable;
13
14class Error implements \JsonSerializable
15{
17 protected $code;
18
20 protected $message;
24 protected $customData;
25
34 public function __construct($message, $code = 0, $customData = null)
35 {
36 $this->message = $message;
37 $this->code = $code;
38 $this->customData = $customData;
39 }
40
45 public static function createFromThrowable(Throwable $exception): static
46 {
47 return new static($exception->getMessage(), $exception->getCode());
48 }
49
54 public function getCode()
55 {
56 return $this->code;
57 }
58
63 public function getMessage()
64 {
65 return (string) $this->message;
66 }
67
69 {
70 return $this->message instanceof LocalizableMessageInterface ? $this->message : null;
71 }
72
76 public function getCustomData()
77 {
78 return $this->customData;
79 }
80
81 public function __toString()
82 {
83 return $this->getMessage();
84 }
85
93 #[\ReturnTypeWillChange]
94 public function jsonSerialize()
95 {
96 return [
97 'message' => $this->getMessage(),
98 'code' => $this->getCode(),
99 'customData' => $this->getCustomData(),
100 ];
101 }
102
106 public function __unserialize(array $data): void
107 {
108 }
109}
Определения error.php:15
getMessage()
Определения error.php:63
__unserialize(array $data)
Определения error.php:106
static createFromThrowable(Throwable $exception)
Определения error.php:45
__toString()
Определения error.php:81
$code
Определения error.php:17
__construct($message, $code=0, $customData=null)
Определения error.php:34
getLocalizableMessage()
Определения error.php:68
getCode()
Определения error.php:54
$message
Определения error.php:20
jsonSerialize()
Определения error.php:94
getCustomData()
Определения error.php:76
$customData
Определения error.php:24
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804