mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-26 03:09:10 +02:00
Don't silenty ignore duplicate errors when managing Panes/Dashlets
This commit is contained in:
parent
a118831b38
commit
12af0d2ce1
@ -242,8 +242,13 @@ class DashboardHome extends BaseDashboard implements Sortable
|
|||||||
'priority' => $movePane ? $order++ : $pane->getPriority()
|
'priority' => $movePane ? $order++ : $pane->getPriority()
|
||||||
], $filterCondition);
|
], $filterCondition);
|
||||||
} else {
|
} else {
|
||||||
// Failed to move the pane! Should have been handled already by the caller
|
// Failed to move the pane! Should have already been handled by the caller,
|
||||||
break;
|
// 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);
|
$pane->setHome($this);
|
||||||
|
@ -236,8 +236,13 @@ class Pane extends BaseDashboard implements Sortable
|
|||||||
'disabled' => DBUtils::bool2BoolEnum($dashlet->isDisabled())
|
'disabled' => DBUtils::bool2BoolEnum($dashlet->isDisabled())
|
||||||
], $filterCondition);
|
], $filterCondition);
|
||||||
} else {
|
} else {
|
||||||
// This should have already been handled by the caller
|
// Failed to move the pane! Should have already been handled by the caller,
|
||||||
break;
|
// 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);
|
$dashlet->setPane($this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user