manticoresoftware / manticoresearch-php

Official PHP client for Manticore Search
MIT License
167 stars 32 forks source link

It doesn't throw ResponseException on response error #181

Closed markomilivojevic closed 9 months ago

markomilivojevic commented 9 months ago

Manticore version:

6.2.13 26388a5ac@231124 dev (columnar 2.2.5 5578d83@231122) (secondary 2.2.5 5578d83@231122) (knn 2.2.5 5578d83@231122)

Manticore PHP lib version:

dev-master#57716bb8e5145ebf0873890a428434a42942c77b

It should throw ResponseException when calling such code:


$index = $client->index('dummy');
$result = $index->search('test')->get();

// Response contains error, but no exception is thrown:
// [{"total":0,"warning":"","error":"unknown local table(s) \'dummy\' in search request"}]

var_dump($result->getResponse()); // regular response, no exception
tomatolog commented 9 months ago

could you provide complete reproducible example? as http::execute https://github.com/manticoresoftware/manticoresearch-php/blob/master/src/Manticoresearch/Transport/Http.php#L29 already checks for error and trows ResponseException here https://github.com/manticoresoftware/manticoresearch-php/blob/master/src/Manticoresearch/Transport/Http.php#L121