diff --git a/library/Director/Data/Db/DbObject.php b/library/Director/Data/Db/DbObject.php index 77e2f6b8..72d014ac 100644 --- a/library/Director/Data/Db/DbObject.php +++ b/library/Director/Data/Db/DbObject.php @@ -10,6 +10,7 @@ namespace Icinga\Module\Director\Data\Db; use Icinga\Exception\IcingaException as IE; use Icinga\Exception\NotFoundError; +use Icinga\Module\Director\Exception\DuplicateKeyException; use Icinga\Module\Director\Util; use Exception; use Zend_Db_Adapter_Abstract; @@ -725,7 +726,7 @@ abstract class DbObject } } else { if ($id && $this->existsInDb()) { - throw new IE( + throw new DuplicateKeyException( 'Trying to recreate %s (%s)', $table, $this->getLogId() diff --git a/library/Director/Exception/DuplicateKeyException.php b/library/Director/Exception/DuplicateKeyException.php new file mode 100644 index 00000000..ed0d0128 --- /dev/null +++ b/library/Director/Exception/DuplicateKeyException.php @@ -0,0 +1,7 @@ +