Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
util.php
1<?php
2
4
9
10class Util
11{
12 public static function getHttpClientError(HttpClient $httpClient): ?Error
13 {
14 $err = $httpClient->getError();
15 if (empty($err))
16 {
17 return null;
18 }
19 $code = array_key_first($err);
20
21 return new Error($err[$code], $code);
22 }
23
24 public static function getHttpClientErrorString(HttpClient $httpClient): ?string
25 {
26 $err = $httpClient->getError();
27 if (empty($err))
28 {
29 return null;
30 }
31 $code = array_key_first($err);
32
33 return "[{$code}]: {$err[$code]}";
34 }
35}
static getHttpClientErrorString(HttpClient $httpClient)
Definition util.php:24
static getHttpClientError(HttpClient $httpClient)
Definition util.php:12