Skip to content

Commit

Permalink
Improved error messaging in the database fixture manager file, show c…
Browse files Browse the repository at this point in the history
…ause 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
  • Loading branch information
eduardor2k committed Aug 9, 2023
1 parent 4af7dcf commit 073cc71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion framework/test/CDbFixtureManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 073cc71

Please sign in to comment.