diff --git a/library/Icinga/Web/Dashboard/DashboardHome.php b/library/Icinga/Web/Dashboard/DashboardHome.php index 8c5b786d7..b8d0d78d9 100644 --- a/library/Icinga/Web/Dashboard/DashboardHome.php +++ b/library/Icinga/Web/Dashboard/DashboardHome.php @@ -242,8 +242,13 @@ class DashboardHome extends BaseDashboard implements Sortable 'priority' => $movePane ? $order++ : $pane->getPriority() ], $filterCondition); } else { - // Failed to move the pane! Should have been handled already by the caller - break; + // Failed to move the pane! Should have already been handled by the caller, + // though I think it's better that we raise an exception here!! + throw new \LogicException(sprintf( + 'Dashboard Pane "%s" could not be managed. Dashboard Home "%s" has Pane with the same name!', + $pane->getTitle(), + $this->getTitle() + )); } $pane->setHome($this); diff --git a/library/Icinga/Web/Dashboard/Pane.php b/library/Icinga/Web/Dashboard/Pane.php index bbe997061..7035230e6 100644 --- a/library/Icinga/Web/Dashboard/Pane.php +++ b/library/Icinga/Web/Dashboard/Pane.php @@ -236,8 +236,13 @@ class Pane extends BaseDashboard implements Sortable 'disabled' => DBUtils::bool2BoolEnum($dashlet->isDisabled()) ], $filterCondition); } else { - // This should have already been handled by the caller - break; + // Failed to move the pane! Should have already been handled by the caller, + // though I think it's better that we raise an exception here!! + throw new \LogicException(sprintf( + 'Dashlet "%s" could not be managed. Dashboard Pane "%s" has a Dashlet with the same name!', + $dashlet->getTitle(), + $this->getTitle() + )); } $dashlet->setPane($this);