Skip to content

Commit

Permalink
Queue: don't keep previous exception, because leak token to log
Browse files Browse the repository at this point in the history
  • Loading branch information
h4kuna committed Nov 9, 2023
1 parent 3a0b572 commit 45c7b64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Exceptions/ServiceUnavailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace h4kuna\Fio\Exceptions;

class ServiceUnavailable extends \RuntimeException
use Psr\Http\Client\ClientExceptionInterface;

class ServiceUnavailable extends \RuntimeException implements ClientExceptionInterface
{

}
2 changes: 1 addition & 1 deletion src/Utils/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private function request(string $token, RequestInterface $request): ResponseInte
return $response;
} catch (ClientExceptionInterface $e) {
$message = str_replace($token, Strings::truncate($token, 10), $e->getMessage());
throw new Exceptions\ServiceUnavailable($message, $e->getCode(), $e);
throw new Exceptions\ServiceUnavailable($message, $e->getCode()); // in url is token, don't need keep previous exception
} finally {
fclose($file);
}
Expand Down

0 comments on commit 45c7b64

Please sign in to comment.