diff --git a/classes/Category.php b/classes/Category.php index 51c0ab67b..bff1b2455 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -365,7 +365,7 @@ class CategoryCore extends ObjectModel $parent_category = new Category($this->id_parent); if (!Validate::isLoadedObject($parent_category)) - die('parent category does not exist'); + throw new PrestaShopException('Parent category does not exist'); return $parent_category->level_depth + 1; }