88use Elastic \Elasticsearch \Exception \MissingParameterException ;
99use Elastic \Elasticsearch \Exception \ServerResponseException ;
1010use Symfony \Component \HttpFoundation \Response ;
11- use Symfony \Component \HttpKernel \Exception \HttpException ;
12- use Symfony \Component \HttpKernel \Exception \NotFoundHttpException ;
1311use Symfony \Contracts \HttpClient \Exception \ClientExceptionInterface ;
1412use Symfony \Contracts \HttpClient \Exception \DecodingExceptionInterface ;
1513use Symfony \Contracts \HttpClient \Exception \RedirectionExceptionInterface ;
@@ -60,19 +58,19 @@ public function process(string $indexName, string $url): void
6058 * @throws RedirectionExceptionInterface
6159 * @throws ServerExceptionInterface
6260 * @throws TransportExceptionInterface
63- * @throws HttpException
61+ * @throws \ HttpException
6462 */
6563 private function download (string $ url ): array
6664 {
6765 // Load from local file if using "file" URL scheme.
6866 if (preg_match ('~^file://(?<path>/.+)$~ ' , $ url , $ matches )) {
6967 $ path = $ matches ['path ' ];
7068 if (!is_readable ($ path )) {
71- throw new NotFoundHttpException ('Unable to download fixture data ' );
69+ throw new \ HttpException ('Unable to load fixture data ' );
7270 }
7371 $ data = json_decode (file_get_contents ($ path ), true );
7472 if (empty ($ data )) {
75- throw new NotFoundHttpException ('Unable to download fixture data ' );
73+ throw new \ HttpException ('Unable to load fixture data ' );
7674 }
7775
7876 return $ data ;
@@ -81,7 +79,7 @@ private function download(string $url): array
8179 $ response = $ this ->httpClient ->request ('GET ' , $ url );
8280
8381 if (Response::HTTP_OK !== $ response ->getStatusCode ()) {
84- throw new NotFoundHttpException ('Unable to download fixture data ' );
82+ throw new \ HttpException ('Unable to download fixture data ' );
8583 }
8684
8785 return $ response ->toArray ();
0 commit comments