Fix response when route not found

This commit is contained in:
Michał Pysiak 2024-10-24 17:52:36 +02:00
parent 33ca5784a0
commit de841ff3f2
No known key found for this signature in database
GPG key ID: 9C1F2D0F99830187

View file

@ -183,7 +183,13 @@ final class ApiPlatformClient implements ApiClientInterface
$this->getToken(),
);
$this->request->setContent(json_decode($response->getContent(), true));
try {
$content = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
} catch (\Exception ) {
$content = [];
}
$this->request->setContent($content);
return $this;
}