From 073cc7130d53b02b91f8bb3eafbaec7680d43c6e Mon Sep 17 00:00:00 2001 From: Eduardo Date: Wed, 9 Aug 2023 12:32:47 +0200 Subject: [PATCH] Improved error messaging in the database fixture manager file, show cause of the error when fixture can't be loaded When a fixture can't be loaded, you only get a generic error telling you which fixture can't be loaded, it would be more helpful if in that message we get the cause of the error --- CHANGELOG | 1 + framework/test/CDbFixtureManager.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index b9efe120d7..f9436150ba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ Version 1.1.29 under development -------------------------------- +- New: Improved error messaging in the database fixture manager file (eduardor2k) - Bug #4516: PHP 8 compatibility: Allow union types and intersection types in action declarations (wtommyw) - Bug #4523: Fixed translated in Greek class messages in framework requirements view, which they should not be translated (lourdas) diff --git a/framework/test/CDbFixtureManager.php b/framework/test/CDbFixtureManager.php index 0ad98d4972..7d30886bc6 100644 --- a/framework/test/CDbFixtureManager.php +++ b/framework/test/CDbFixtureManager.php @@ -173,7 +173,7 @@ public function loadFixture($tableName) try { $builder->createInsertCommand($table,$row)->execute(); } catch (CException $e) { - throw new CException('Exception loading row ' . $alias . ' in fixture ' . $fileName, $e->getCode(), $e); + throw new CException('Exception loading row ' . $alias . ' in fixture ' . $fileName . ', Error: ' . $e->getMessage(), $e->getCode(), $e); } $primaryKey=$table->primaryKey; if($table->sequenceName!==null)