Skip to content

Commit

Permalink
throw index not found exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeniau committed Jan 20, 2015
1 parent da0d7c3 commit bce448a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Elastica/Index/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Elastica\Index;

use Elastica\Exception\NotFoundException;
use Elastica\Index as BaseIndex;
use Elastica\Request;

Expand Down Expand Up @@ -69,7 +70,7 @@ public function get($setting = '')
$data = reset($requestData);

if (empty($data['settings']) || empty($data['settings']['index'])) {
return []; // index not found
throw new NotFoundException('Index ' . $this->getIndex()->getName() . ' not found'); // index not found
}
$settings = $data['settings']['index'];

Expand Down

0 comments on commit bce448a

Please sign in to comment.