Commit 29f5474dd1037a1ec0cfffa729715b2fdcdf3160

Authored by Moritz Wirger
1 parent 3fdc280c

Fix some error messages

hueplusplus/HttpHandler.cpp 100644 → 100755
@@ -270,8 +270,8 @@ Json::Value HttpHandler::GETJson(std::string uri, const Json::Value& body, const @@ -270,8 +270,8 @@ Json::Value HttpHandler::GETJson(std::string uri, const Json::Value& body, const
270 std::unique_ptr<Json::CharReader> reader = std::unique_ptr<Json::CharReader>(builder.newCharReader()); 270 std::unique_ptr<Json::CharReader> reader = std::unique_ptr<Json::CharReader>(builder.newCharReader());
271 if (!reader->parse(response.c_str(), response.c_str() + response.length(), &result, &error)) 271 if (!reader->parse(response.c_str(), response.c_str() + response.length(), &result, &error))
272 { 272 {
273 - std::cout << "Error while parsing JSON in function SendRequest() of HueLight: " << error << std::endl;  
274 - throw(std::runtime_error("Error while parsing JSON in function SendRequest() of HueLight")); 273 + std::cout << "Error while parsing JSON in function GETJson() of HttpHandler: " << error << std::endl;
  274 + throw(std::runtime_error("Error while parsing JSON in function GETJson() of HttpHandler"));
275 } 275 }
276 return result; 276 return result;
277 } 277 }
@@ -287,8 +287,8 @@ Json::Value HttpHandler::POSTJson(std::string uri, const Json::Value&amp; body, cons @@ -287,8 +287,8 @@ Json::Value HttpHandler::POSTJson(std::string uri, const Json::Value&amp; body, cons
287 std::unique_ptr<Json::CharReader> reader = std::unique_ptr<Json::CharReader>(builder.newCharReader()); 287 std::unique_ptr<Json::CharReader> reader = std::unique_ptr<Json::CharReader>(builder.newCharReader());
288 if (!reader->parse(response.c_str(), response.c_str() + response.length(), &result, &error)) 288 if (!reader->parse(response.c_str(), response.c_str() + response.length(), &result, &error))
289 { 289 {
290 - std::cout << "Error while parsing JSON in function SendRequest() of HueLight: " << error << std::endl;  
291 - throw(std::runtime_error("Error while parsing JSON in function SendRequest() of HueLight")); 290 + std::cout << "Error while parsing JSON in function POSTJson() of HttpHandler: " << error << std::endl;
  291 + throw(std::runtime_error("Error while parsing JSON in function POSTJson() of HttpHandler"));
292 } 292 }
293 return result; 293 return result;
294 } 294 }
@@ -304,8 +304,8 @@ Json::Value HttpHandler::PUTJson(std::string uri, const Json::Value&amp; body, const @@ -304,8 +304,8 @@ Json::Value HttpHandler::PUTJson(std::string uri, const Json::Value&amp; body, const
304 std::unique_ptr<Json::CharReader> reader = std::unique_ptr<Json::CharReader>(builder.newCharReader()); 304 std::unique_ptr<Json::CharReader> reader = std::unique_ptr<Json::CharReader>(builder.newCharReader());
305 if (!reader->parse(response.c_str(), response.c_str() + response.length(), &result, &error)) 305 if (!reader->parse(response.c_str(), response.c_str() + response.length(), &result, &error))
306 { 306 {
307 - std::cout << "Error while parsing JSON in function SendRequest() of HueLight: " << error << std::endl;  
308 - throw(std::runtime_error("Error while parsing JSON in function SendRequest() of HueLight")); 307 + std::cout << "Error while parsing JSON in function PUTJson() of HttpHandler: " << error << std::endl;
  308 + throw(std::runtime_error("Error while parsing JSON in function PUTJson() of HttpHandler"));
309 } 309 }
310 return result; 310 return result;
311 } 311 }
hueplusplus/Hue.cpp 100644 → 100755
@@ -291,6 +291,6 @@ void Hue::refreshState() @@ -291,6 +291,6 @@ void Hue::refreshState()
291 } 291 }
292 else 292 else
293 { 293 {
294 - std::cout << "Answer in refreshState() of HttpHandler().sendGetHTTPBody() is not expected!\n"; 294 + std::cout << "Answer in Hue::refreshState of HttpHandler().GETJson(...) is not expected!\n";
295 } 295 }
296 } 296 }
hueplusplus/HueLight.cpp 100644 → 100755
hueplusplus/include/HttpHandler.h 100644 → 100755