Commit d97f5edf by Carsten Brandt

improved error reporting of elasticsearch ActiveFixture

parent b3382404
......@@ -101,7 +101,11 @@ class ActiveFixture extends BaseActiveFixture
$options = [];
$id = isset($row[$idField]) ? $row[$idField] : null;
$response = $this->db->createCommand()->insert($this->index, $this->type, $row, $id, $options);
try {
$response = $this->db->createCommand()->insert($this->index, $this->type, $row, $id, $options);
} catch(\yii\db\Exception $e) {
throw new \yii\base\Exception("Failed to insert fixture data \"$alias\": " . $e->getMessage() . "\n" . print_r($e->errorInfo, true), $e->getCode(), $e);
}
if ($id === null) {
$row[$idField] = $response['_id'];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment