some stderr output on error

This commit is contained in:
josch
2014-09-23 20:52:30 +02:00
parent 7e4717c18f
commit 6e546fa3f3
2 changed files with 7 additions and 2 deletions

View File

@@ -106,12 +106,15 @@ static int _decode_get_session_token(mfhttp * conn, void *user_ptr)
root = http_parse_buf_json(conn, 0, &error);
data = json_object_by_path(root, "response");
if (data == NULL)
if (data == NULL) {
fprintf(stderr, "json: no /response content\n");
return -1;
}
session_token = json_object_get(data, "session_token");
if (session_token == NULL) {
json_decref(root);
fprintf(stderr, "json: no /session_token content\n");
return -1;
}

View File

@@ -66,8 +66,10 @@ mfconn *mfconn_create(const char *server, const char *username,
if (retval == 0)
return conn;
else
else {
fprintf(stderr, "error: mfconn_api_user_get_session_token\n");
return NULL;
}
}
void mfconn_destroy(mfconn * conn)