Skip to content

Commit 45bdb2c

Browse files
committed
Rename HTTPRequestException into ApiException
1 parent 12a93e9 commit 45bdb2c

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/Command/MeiliSearchImportCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use MeiliSearch\Bundle\Model\Aggregator;
99
use MeiliSearch\Bundle\SearchService;
1010
use MeiliSearch\Client;
11-
use MeiliSearch\Exceptions\HTTPRequestException;
11+
use MeiliSearch\Exceptions\ApiException;
1212
use MeiliSearch\Exceptions\TimeOutException;
1313
use Symfony\Component\Console\Input\InputInterface;
1414
use Symfony\Component\Console\Input\InputOption;
@@ -76,7 +76,7 @@ protected function configure()
7676
* {@inheritdoc}
7777
*
7878
* @throws TimeOutException
79-
* @throws HTTPRequestException
79+
* @throws ApiException
8080
*/
8181
protected function execute(InputInterface $input, OutputInterface $output): int
8282
{

src/Engine.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace MeiliSearch\Bundle;
44

55
use MeiliSearch\Client;
6-
use MeiliSearch\Exceptions\HTTPRequestException;
6+
use MeiliSearch\Exceptions\ApiException;
77
use Symfony\Component\Serializer\Exception\ExceptionInterface;
88
use function count;
99
use function reset;
@@ -37,7 +37,7 @@ public function __construct(Client $client)
3737
*
3838
* @return array
3939
*
40-
* @throws HTTPRequestException
40+
* @throws ApiException
4141
* @throws ExceptionInterface
4242
*/
4343
public function index($searchableEntities): array
@@ -121,7 +121,7 @@ public function remove($searchableEntities): array
121121
*
122122
* @return array
123123
*
124-
* @throws HTTPRequestException
124+
* @throws ApiException
125125
*/
126126
public function clear(string $indexName): array
127127
{

tests/TestCase/CommandsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use MeiliSearch\Bundle\Test\Entity\Post;
1515
use MeiliSearch\Client;
1616
use MeiliSearch\Endpoints\Indexes;
17-
use MeiliSearch\Exceptions\HTTPRequestException;
17+
use MeiliSearch\Exceptions\ApiException;
1818
use Symfony\Bundle\FrameworkBundle\Console\Application;
1919
use Symfony\Component\Console\Tester\CommandTester;
2020

@@ -53,7 +53,7 @@ class CommandsTest extends BaseTest
5353
/**
5454
* @inheritDoc
5555
* @throws DBALException
56-
* @throws HTTPRequestException
56+
* @throws ApiException
5757
* @throws Exception
5858
*/
5959
public function setUp(): void
@@ -77,7 +77,7 @@ public function cleanUp()
7777
$this->searchService->delete(Post::class);
7878
$this->searchService->delete(Comment::class);
7979
$this->searchService->delete(ContentAggregator::class);
80-
} catch (HTTPRequestException $e) {
80+
} catch (ApiException $e) {
8181
$this->assertEquals('Index sf_phpunit__comments not found', $e->getMessage());
8282
}
8383
}

tests/TestCase/EngineTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Exception;
66
use MeiliSearch\Bundle\Engine;
77
use MeiliSearch\Bundle\Test\BaseTest;
8-
use MeiliSearch\Exceptions\HTTPRequestException;
8+
use MeiliSearch\Exceptions\ApiException;
99

1010
/**
1111
* Class EngineTest
@@ -45,7 +45,7 @@ public function testIndexingEmptyEntity()
4545
try {
4646
$this->engine->search('query', $searchableImage->getIndexName(), []);
4747
} catch (Exception $e) {
48-
$this->assertInstanceOf(HTTPRequestException::class, $e);
48+
$this->assertInstanceOf(ApiException::class, $e);
4949
}
5050
}
5151
}

tests/TestCase/SearchTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use MeiliSearch\Bundle\Test\Entity\Post;
1515
use MeiliSearch\Client;
1616
use MeiliSearch\Endpoints\Indexes;
17-
use MeiliSearch\Exceptions\HTTPRequestException;
17+
use MeiliSearch\Exceptions\ApiException;
1818
use Symfony\Bundle\FrameworkBundle\Console\Application;
1919
use Symfony\Component\Console\Tester\CommandTester;
2020

@@ -53,7 +53,7 @@ class SearchTest extends BaseTest
5353
/**
5454
* @inheritDoc
5555
* @throws DBALException
56-
* @throws HTTPRequestException
56+
* @throws ApiException
5757
* @throws Exception
5858
*/
5959
public function setUp(): void
@@ -77,7 +77,7 @@ public function cleanUp()
7777
$this->searchService->delete(Post::class);
7878
$this->searchService->delete(Comment::class);
7979
$this->searchService->delete(ContentAggregator::class);
80-
} catch (HTTPRequestException $e) {
80+
} catch (ApiException $e) {
8181
$this->assertEquals('Index sf_phpunit__comments not found', $e->getMessage());
8282
}
8383
}

0 commit comments

Comments
 (0)