/** * Checks the MQTTResponse for errors and throws an exception, if * no errors are encountered, the MQTTResponse is returned. * * @param MQTTResponse $response * @return HttpResponse * @throws M2XException */ protected function handleResponse(MQTTResponse $response) { $this->lastResponse = $response; if ($response->success()) { return $response; } throw new M2XException($response); }