phpClickHouse
phpClickHouse copied to clipboard
check response body to detect error/exception
Sometimes ClickHouse returns 200 OK when exception occured
for details see https://github.com/ClickHouse/ClickHouse/issues/15124
currently \ClickHouseDB\Statement
<?php
/**
* @return bool
* @throws Exception\TransportException
*/
public function isError()
{
return ($this->response()->http_code() !== 200 || $this->response()->error_no());
}
suggest to check response body too
<?php
/**
* @return bool
* @throws Exception\TransportException
*/
public function isError()
{
return ($this->response()->http_code() !== 200)
|| $this->response()->error_no()
|| (\stripos($this->response()->body(), 'DB::Exception') !== false);
}
are there any plans to solve this problem?