1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
ErrorInformant.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\MessageService\Providers\Twilio
;
4
5
use
Bitrix\Main\Error
;
6
use
Bitrix\Main\Localization\Loc
;
7
8
class
ErrorInformant
9
{
10
protected
?
int
$code
;
11
protected
int
$httpStatus
;
12
protected
?
string
$message
;
13
protected
?
string
$moreInfo
;
14
20
public
function
__construct
(?
string
$message
, ?
int
$code
, ?
string
$moreInfo
,
int
$httpStatus
)
21
{
22
$this->code =
$code
;
23
$this->message =
$message
;
24
$this->moreInfo =
$moreInfo
;
25
$this->httpStatus =
$httpStatus
;
26
}
27
28
public
function
getError
():
Error
29
{
30
return
new
Error
($this->
getErrorMessage
(), $this->code ?? 0);
31
}
32
33
protected
function
getErrorMessage
(): string
34
{
35
36
$str
= Loc::getMessage(
'MESSAGESERVICE_PROVIDER_TWILIO_ERROR_INFORMANT_ERROR'
, [
37
'#BR#'
=>
'<br>'
,
38
]);
39
40
if
(isset($this->moreInfo))
41
{
42
$str
.= Loc::getMessage(
'MESSAGESERVICE_PROVIDER_TWILIO_ERROR_INFORMANT_ERROR_MORE'
, [
43
'#LINKSTART#'
=>
'<a href="'
. $this->moreInfo .
'" target="_blank">'
,
44
'#INFO#'
=> $this->moreInfo,
45
'#LINKEND#'
=>
'</a>'
,
46
]);
47
48
return
$str
;
49
}
50
51
if
(isset($this->message, $this->code))
52
{
53
$str
.= Loc::getMessage(
'MESSAGESERVICE_PROVIDER_TWILIO_ERROR_INFORMANT_ERROR_CODE'
, [
54
'#CODE#'
=> $this->code,
55
'#MESSAGE#'
=> $this->message,
56
]);
57
58
return
$str
;
59
}
60
61
$str
.= Loc::getMessage(
'MESSAGESERVICE_PROVIDER_TWILIO_ERROR_INFORMANT_ERROR_HTTP_STATUS'
, [
62
'#STATUS#'
=> $this->httpStatus,
63
]);
64
65
return
$str
;
66
}
67
}
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\Localization\Loc
Определения
loc.php:12
Bitrix\MessageService\Providers\Twilio\ErrorInformant
Определения
ErrorInformant.php:9
Bitrix\MessageService\Providers\Twilio\ErrorInformant\getError
getError()
Определения
ErrorInformant.php:28
Bitrix\MessageService\Providers\Twilio\ErrorInformant\$message
string $message
Определения
ErrorInformant.php:12
Bitrix\MessageService\Providers\Twilio\ErrorInformant\getErrorMessage
getErrorMessage()
Определения
ErrorInformant.php:33
Bitrix\MessageService\Providers\Twilio\ErrorInformant\__construct
__construct(?string $message, ?int $code, ?string $moreInfo, int $httpStatus)
Определения
ErrorInformant.php:20
Bitrix\MessageService\Providers\Twilio\ErrorInformant\$moreInfo
string $moreInfo
Определения
ErrorInformant.php:13
Bitrix\MessageService\Providers\Twilio\ErrorInformant\$httpStatus
int $httpStatus
Определения
ErrorInformant.php:11
Bitrix\MessageService\Providers\Twilio\ErrorInformant\$code
int $code
Определения
ErrorInformant.php:10
$str
$str
Определения
commerceml2.php:63
Bitrix\MessageService\Providers\Twilio
Определения
ErrorInformant.php:3
bitrix
modules
messageservice
lib
Providers
Twilio
ErrorInformant.php
Создано системой
1.14.0