Skip to content

Commit d91a3c9

Browse files
author
Quentin Farizon
committed
Catch throwables in mview updating
1 parent c63b388 commit d91a3c9

File tree

1 file changed

+8
-1
lines changed
  • lib/internal/Magento/Framework/Mview

1 file changed

+8
-1
lines changed

lib/internal/Magento/Framework/Mview/View.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,19 @@ public function update()
277277
? View\StateInterface::STATUS_SUSPENDED
278278
: View\StateInterface::STATUS_IDLE;
279279
$this->getState()->setVersionId($currentVersionId)->setStatus($statusToRestore)->save();
280-
} catch (Exception $exception) {
280+
} catch (\Throwable $exception) {
281281
$this->getState()->loadByView($this->getId());
282282
$statusToRestore = $this->getState()->getStatus() === View\StateInterface::STATUS_SUSPENDED
283283
? View\StateInterface::STATUS_SUSPENDED
284284
: View\StateInterface::STATUS_IDLE;
285285
$this->getState()->setStatus($statusToRestore)->save();
286+
if (!$exception instanceof \Exception) {
287+
$exception = new \RuntimeException(
288+
'Error when updating an mview',
289+
0,
290+
$exception
291+
);
292+
}
286293
throw $exception;
287294
}
288295
}

0 commit comments

Comments
 (0)