Skip to content

Commit

Permalink
Merge pull request #49 from spira/feature/elasticsearch-exception
Browse files Browse the repository at this point in the history
Fix ElasticSearchIndexer exception
  • Loading branch information
Jeremy Sik committed Apr 19, 2016
2 parents 1d31ab7 + 13a93e0 commit c37fe48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Model/Model/ElasticSearchIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function getRelationsForReindex(IndexedModel $model)
protected function getRelationItems(IndexedModel $model, $relation)
{
if (! method_exists($model, $relation)) {
throw new \Exception(sprintf('Tried to reindex unexistant relation "%s" on model "%s"', $relation, $model->getMorphClass()));
throw new \BadMethodCallException(sprintf('Tried to reindex non-existent relation "%s" on model "%s"', $relation, $model->getMorphClass()));
}

/** @var Relation $rel */
Expand Down
4 changes: 2 additions & 2 deletions tests/ElasticSearchIndexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class ElasticSearchIndexerTest extends TestCase
{
/**
* @expectedException \Exception
* @expectedExceptionMessage Tried to reindex unexistant relation "badRelation" on model "Spira\Core\Model\Model\IndexedModel"
* @expectedException \BadMethodCallException
* @expectedExceptionMessage Tried to reindex non-existent relation "badRelation" on model "Spira\Core\Model\Model\IndexedModel"
*/
public function testUnexistantRelationError()
{
Expand Down

0 comments on commit c37fe48

Please sign in to comment.