From a427ec9c39ec6fa68d4ec23937f7a1bf8c105318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Mat=C4=9Bj=C4=8Dek?= Date: Mon, 30 Oct 2023 08:49:03 +0100 Subject: [PATCH] Remove token from report. --- src/Utils/Queue.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Utils/Queue.php b/src/Utils/Queue.php index 580a09a..79e3ae7 100644 --- a/src/Utils/Queue.php +++ b/src/Utils/Queue.php @@ -4,10 +4,10 @@ use h4kuna\Dir\TempDir; use h4kuna\Fio\Exceptions; -use h4kuna\Fio\FioRead; use h4kuna\Fio\Pay\Response; use h4kuna\Fio\Pay\XMLResponse; use Nette\SafeStream; +use Nette\Utils\Strings; use Psr\Http\Client\ClientExceptionInterface; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestInterface; @@ -103,7 +103,8 @@ private function request(string $token, RequestInterface $request): ResponseInte return $response; } catch (ClientExceptionInterface $e) { - throw new Exceptions\ServiceUnavailable($e->getMessage(), $e->getCode(), $e); + $message = str_replace($token, Strings::truncate($token, 10), $e->getMessage()); + throw new Exceptions\ServiceUnavailable($message, $e->getCode(), $e); } finally { fclose($file); }