sanchezzzhak / kak-clickhouse

Yii2 ext. ClickHouse
69 stars 43 forks source link

Incorrect response error code #6

Closed rowdyroad closed 7 years ago

rowdyroad commented 7 years ago

Hi. I've have a mistake in my clickhouse query and received 404 response code from clickhouse.

["_headers":"yii\httpclient\Message":private]=> object(yii\web\HeaderCollection)#40 (1) { ["_headers":"yii\web\HeaderCollection":private]=> array(6) { ["http-code"]=> array(1) { [0]=> string(3) "404" } ["date"]=> array(1) { [0]=> string(29) "Mon, 24 Apr 2017 10:32:16 GMT" } ["connection"]=> array(1) { [0]=> string(10) "Keep-Alive" } ["content-type"]=> array(1) { [0]=> string(25) "text/plain; charset=UTF-8" } ["transfer-encoding"]=> array(1) { [0]=> string(7) "chunked" } ["keep-alive"]=> array(1) { [0]=> string(9) "timeout=3" } } }

What's why code: /** Raise exception when get 500s error */ if ($response->statusCode >= 500) { throw new DbException($response->getContent()); }

does't fire exception.

By the way, there is only 200 and 500 response code in HTTP interface of clickhouse In documentation.

sanchezzzhak commented 7 years ago

Hi, I'll check and fix immediately. many thanks

sanchezzzhak commented 7 years ago

done, fix method execute was no check for httpcode==200