diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index fca827ca2505f..0e5af82a8200b 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -299,12 +299,19 @@ public function update() ? View\StateInterface::STATUS_SUSPENDED : View\StateInterface::STATUS_IDLE; $this->getState()->setVersionId($currentVersionId)->setStatus($statusToRestore)->save(); - } catch (\Exception $exception) { + } catch (\Throwable $exception) { $this->getState()->loadByView($this->getId()); $statusToRestore = $this->getState()->getStatus() == View\StateInterface::STATUS_SUSPENDED ? View\StateInterface::STATUS_SUSPENDED : View\StateInterface::STATUS_IDLE; $this->getState()->setStatus($statusToRestore)->save(); + if (!$exception instanceof \Exception) { + $exception = new \RuntimeException( + 'Error when updating an mview', + 0, + $exception + ); + } throw $exception; } }