Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Buzz\Exception\ClientException;
use Jobcloud\Kafka\SchemaRegistryClient\Exception\BackendDatastoreException;
use Jobcloud\Kafka\SchemaRegistryClient\Exception\ImportException;
use Jobcloud\Kafka\SchemaRegistryClient\Exception\CompatibilityException;
use Jobcloud\Kafka\SchemaRegistryClient\Exception\ImportException;
use Jobcloud\Kafka\SchemaRegistryClient\Exception\IncompatibileAvroSchemaException;
use Jobcloud\Kafka\SchemaRegistryClient\Exception\InvalidAvroSchemaException;
use Jobcloud\Kafka\SchemaRegistryClient\Exception\InvalidVersionException;
Expand All @@ -18,10 +18,10 @@
use Jobcloud\Kafka\SchemaRegistryClient\Exception\UnauthorizedException;
use Jobcloud\Kafka\SchemaRegistryClient\Exception\UnprocessableEntityException;
use Jobcloud\Kafka\SchemaRegistryClient\Exception\VersionNotFoundException;
use JsonException;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use JsonException;

class ErrorHandler implements ErrorHandlerInterface
{
Expand All @@ -45,8 +45,11 @@ class ErrorHandler implements ErrorHandlerInterface
* @throws ClientExceptionInterface
* @throws SchemaRegistryExceptionInterface
*/
public function handleError(ResponseInterface $response, string $uri = null, RequestInterface $request = null): void
{
public function handleError(
ResponseInterface $response,
?string $uri = null,
?RequestInterface $request = null
): void {
$responseContent = json_decode($response->getBody(), true, 512, JSON_THROW_ON_ERROR);

if (false === isset($responseContent['error_code'])) {
Expand Down
4 changes: 2 additions & 2 deletions src/ErrorHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface ErrorHandlerInterface
*/
public function handleError(
ResponseInterface $response,
string $uri = null,
RequestInterface $request = null
?string $uri = null,
?RequestInterface $request = null
): void;
}