Skip to content

Commit

Permalink
Show cause of the error when fixture can't not be loaded
Browse files Browse the repository at this point in the history
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 authored Aug 9, 2023
1 parent 4af7dcf commit 4f92891
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -366,4 +366,4 @@ public function getRecord($name,$alias)
else
return false;
}
}
}

0 comments on commit 4f92891

Please sign in to comment.