Add try catch statements around the code when we call modulelist getpath() method

Created on 2 August 2024, 9 months ago

Problem/Motivation

It seems when any Drush commands are run when the module doesn't exist in the codebase it should trigger drupal core ExtensionList and not the AcquiaTelemetryService and hence customer is getting the below error on every drush command ran or cron run etc.

[error]  Drupal\Core\Extension\Exception\UnknownExtensionException: The module does not exist. in Drupal\Core\Extension\ExtensionList->getPathname() (line 519 of /var/www/html/docroot/core/lib/Drupal/Core/Extension/ExtensionList.php) #0 /var/www/html/docroot/core/lib/Drupal/Core/Extension/ExtensionList.php(538): Drupal\Core\Extension\ExtensionList->getPathname()
#1 /var/www/html/docroot/modules/contrib/acquia_connector/src/Services/AcquiaTelemetryService.php(143): Drupal\Core\Extension\ExtensionList->getPath()
#2 /var/www/html/docroot/modules/contrib/acquia_connector/src/Services/AcquiaTelemetryService.php(184): Drupal\acquia_connector\Services\AcquiaTelemetryService->getExtensionInfo()
#3 /var/www/html/docroot/modules/contrib/acquia_connector/src/Services/AcquiaTelemetryService.php(90): Drupal\acquia_connector\Services\AcquiaTelemetryService->getTelemetryData()
#4 /var/www/html/docroot/modules/contrib/acquia_connector/src/EventSubscriber/KernelTerminate/AcquiaTelemetry.php(53): Drupal\acquia_connector\Services\AcquiaTelemetryService->sendTelemetry()

Proposed resolution

Add try catch statements to catch those exceptions.

🐛 Bug report
Status

Needs work

Version

4.0

Component

Code

Created by

🇮🇳India deepakkm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024