Call to undefined method GuzzleHttp\Exception\ConnectException::getResponse() #39544
Open
Description
Preconditions and environment
- Magento version 2.4.7-p3
- Install module
magento/commerce-eventing
- Connect to App Builder using instructions: https://developer.adobe.com/commerce/extensibility/starter-kit/create-integration/
Steps to reproduce
Before the step: Subscribe to events in Adobe Commerce
Before running the command: npm run commerce-event-subscribe
Add an exception to the Model/IOEventsApi/ApiRequestExecutor.php, Example:
try {
$response = $client->request($method, $uri, $params);
throw new \GuzzleHttp\Exception\ConnectException();
} catch (GuzzleException $exception) {
$response = $this->responseFactory->create([
'status' => $exception->getCode(),
'reason' => sprintf(
'Unsuccessful request: `%s %s` resulted in a `%s %s` response:',
$method,
$uri,
$exception->getResponse()->getStatusCode(),
$exception->getResponse()->getReasonPhrase()
) . PHP_EOL . $exception->getResponse()->getBody()->getContents()
]);
}
Run npm run commerce-event-subscribe
OR bin/magento events:subscribe --fields=sku observer.catalog_product_delete_commit_ater
With a valid exception (when the server response is 403/500/404) There will be an error:
Call to undefined method GuzzleHttp\Exception\ConnectException::getResponse()
In my case, instead of adding an exception, I blocked in the firewall URL https://api.adobe.io/ and it triggered the error.
Expected result
Successful event subscriptions
Actual result
Call to undefined method GuzzleHttp\Exception\ConnectException::getResponse()
Additional information
No response
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Assignees
Labels
Type
Projects
Status
On Hold