When a block fires an exception a 500 error occurs. A small block error can take a whole website this way.
When a block fires an exception the block will be hidden in prod mode and the exception will be logged in the production log. In dev mode the exception can be fired (the problem should be solved). In block edit mode show a message: "This block contains an error", so the user knows there is a block.
Maybe:
diff --git a/Document/Page/Grid/Item.php b/Document/Page/Grid/Item.php
index b82db55..8a7501c 100644
— a/Document/Page/Grid/Item.php
+++ b/Document/Page/Grid/Item.php
@@ -65,7 +65,10 @@ class Item
*/
public function getBlock()
{
return $this->block;
+ try {
+ return $this->block;
+ } catch (\Exception $e) {
+ }
}
/**
No thats not needed (see PR)
The block error message only works with
the pull request in this issue is merged, but the issue is still assigned to you. Do you still have to do something, or can you click Code accepted?