Commit 358f9453 authored by Michael Tross's avatar Michael Tross

log response data in case of invalid json response

parent 6274a9f6
......@@ -299,7 +299,8 @@ netatmo_get_token()
json_object *jobj = json_tokener_parse(response->memory);
if (NULL == jobj) {
vdc_report(LOG_ERR, "network: parsing token response failed\n");
vdc_report(LOG_ERR, "network: parsing token response failed, length %d, data:\n%s\n",
response->size, response->memory);
free(response->memory);
free(response);
return NETATMO_AUTH_FAILED;
......@@ -454,7 +455,8 @@ int netatmo_get_devices()
json_object *jobj = json_tokener_parse(response->memory);
if (jobj == NULL) {
vdc_report(LOG_ERR, "network: parsing devicelist response failed\n");
vdc_report(LOG_ERR, "network: parsing devicelist response failed, length: %d, data:\n%s\n",
response->size, response->memory);
free(response->memory);
free(response);
return NETATMO_GETMEASURE_FAILED;
......@@ -733,7 +735,8 @@ netatmo_get_values(netatmo_module_t* mod)
json_object *jobj = json_tokener_parse(response->memory);
if (jobj == NULL) {
vdc_report(LOG_ERR, "network: parsing getmeasure response failed\n");
vdc_report(LOG_ERR, "network: parsing getmeasure response failed, length: %d, data:\n%s\n",
response->size, response->memory);
free(response->memory);
free(response);
return NETATMO_GETMEASURE_FAILED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment