Skip to content

Commit 8667890

Browse files
authored
Catch zend db adapter errors when database is missing (#193)
1 parent af7bb64 commit 8667890

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Helper/Data.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Magento\Store\Model\ScopeInterface;
2121
use Magento\Store\Model\StoreManagerInterface;
2222
use Throwable;
23+
use Zend_Db_Adapter_Exception;
2324

2425
class Data extends AbstractHelper
2526
{
@@ -258,15 +259,15 @@ public function collectModuleConfig(): array
258259
try {
259260
$this->config[$storeId]['enabled'] = $this->scopeConfig->getValue('sentry/environment/enabled', ScopeInterface::SCOPE_STORE)
260261
?? $this->deploymentConfig->get('sentry') !== null;
261-
} catch (TableNotFoundException|FileSystemException|RuntimeException|DomainException $e) {
262+
} catch (TableNotFoundException|FileSystemException|RuntimeException|DomainException|Zend_Db_Adapter_Exception $e) {
262263
$this->config[$storeId]['enabled'] = $this->deploymentConfig->get('sentry') !== null;
263264
}
264265

265266
foreach ($this->configKeys as $key => $config) {
266267
try {
267268
$value = $this->scopeConfig->getValue('sentry/environment/'.$key, ScopeInterface::SCOPE_STORE)
268269
?? $this->deploymentConfig->get('sentry/'.$key);
269-
} catch (TableNotFoundException|FileSystemException|RuntimeException|DomainException $e) {
270+
} catch (TableNotFoundException|FileSystemException|RuntimeException|DomainException|Zend_Db_Adapter_Exception $e) {
270271
$value = $this->deploymentConfig->get('sentry/'.$key);
271272
}
272273

@@ -392,7 +393,7 @@ public function getStore(): ?\Magento\Store\Api\Data\StoreInterface
392393
{
393394
try {
394395
return $this->storeManager->getStore();
395-
} catch (DomainException|NoSuchEntityException $e) {
396+
} catch (DomainException|Zend_Db_Adapter_Exception|NoSuchEntityException $e) {
396397
// If the store is not available, return null
397398
return null;
398399
}

0 commit comments

Comments
 (0)