Throws Exception in constructor for error in first serie

This commit is contained in:
danibrutal
2015-06-18 15:37:41 +02:00
parent d55af50722
commit 72cd8b82bd
2 changed files with 6 additions and 3 deletions

View File

@@ -41,6 +41,10 @@ class ResultSet
// There was an error in the query thrown by influxdb
if (isset($this->parsedResults['error'])) {
throw new InfluxDBClientError($this->parsedResults['error']);
// Check if there are errors in the first serie
} elseif (isset($this->parsedResults['results'][0]['error'])) {
throw new InfluxDBClientError($this->parsedResults['results'][0]['error']);
}
}
@@ -80,7 +84,7 @@ class ResultSet
public function getSeries()
{
$pickSeries = function ($object) {
if (isset($object['error'])) {
throw new InfluxDBClientError($object['error']);
}

View File

@@ -57,8 +57,7 @@ EOD;
]
}
EOD;
$rs = new ResultSet($errorResult);
$rs->getSeries();
new ResultSet($errorResult);
}
/**