4
4
5
5
use Buzz \Exception \ClientException ;
6
6
use Jobcloud \Kafka \SchemaRegistryClient \Exception \BackendDatastoreException ;
7
- use Jobcloud \Kafka \SchemaRegistryClient \Exception \ImportException ;
8
7
use Jobcloud \Kafka \SchemaRegistryClient \Exception \CompatibilityException ;
8
+ use Jobcloud \Kafka \SchemaRegistryClient \Exception \ImportException ;
9
9
use Jobcloud \Kafka \SchemaRegistryClient \Exception \IncompatibileAvroSchemaException ;
10
10
use Jobcloud \Kafka \SchemaRegistryClient \Exception \InvalidAvroSchemaException ;
11
11
use Jobcloud \Kafka \SchemaRegistryClient \Exception \InvalidVersionException ;
18
18
use Jobcloud \Kafka \SchemaRegistryClient \Exception \UnauthorizedException ;
19
19
use Jobcloud \Kafka \SchemaRegistryClient \Exception \UnprocessableEntityException ;
20
20
use Jobcloud \Kafka \SchemaRegistryClient \Exception \VersionNotFoundException ;
21
+ use JsonException ;
21
22
use Psr \Http \Client \ClientExceptionInterface ;
22
23
use Psr \Http \Message \RequestInterface ;
23
24
use Psr \Http \Message \ResponseInterface ;
24
- use JsonException ;
25
25
26
26
class ErrorHandler implements ErrorHandlerInterface
27
27
{
@@ -45,8 +45,11 @@ class ErrorHandler implements ErrorHandlerInterface
45
45
* @throws ClientExceptionInterface
46
46
* @throws SchemaRegistryExceptionInterface
47
47
*/
48
- public function handleError (ResponseInterface $ response , string $ uri = null , RequestInterface $ request = null ): void
49
- {
48
+ public function handleError (
49
+ ResponseInterface $ response ,
50
+ ?string $ uri = null ,
51
+ ?RequestInterface $ request = null
52
+ ): void {
50
53
$ responseContent = json_decode ($ response ->getBody (), true , 512 , JSON_THROW_ON_ERROR );
51
54
52
55
if (false === isset ($ responseContent ['error_code ' ])) {
0 commit comments