Skip to content

Commit

Permalink
Merge pull request #25 from vzhurin/fix_multibyte
Browse files Browse the repository at this point in the history
Fix problem with multibyte characters in the error message
  • Loading branch information
IvanShishkin authored Jul 22, 2021
2 parents 10fb42d + 929b4fd commit 5b04a00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Clients/AbstractMindboxClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ final protected function parseRawResponse(MindboxRequest $request, HttpClientRaw
$body = $context['response']['body'];
$arBody = json_decode($body, true);
if ($arBody) {
$message = substr($arBody['errorMessage'], strpos($arBody['errorMessage'], ":") + 1);
$message = \trim(\array_slice(\explode(':', $arBody['errorMessage'], 2), -1)[0]);
} else {
$message = 'Bad request';
}
Expand Down

0 comments on commit 5b04a00

Please sign in to comment.