aboutsummaryrefslogtreecommitdiff
path: root/src/identity
diff options
context:
space:
mode:
authorPhil <phil.buschmann@tum.de>2018-06-10 19:02:07 +0200
committerPhil <phil.buschmann@tum.de>2018-06-10 19:02:07 +0200
commitc1062075eddca49cfeaac8f7fd8c84e73198c2aa (patch)
tree8df0d081b7c25b43551cff19de191e697898a692 /src/identity
parentf5aae6fb1455b197c54073d0be807b460268da6d (diff)
downloadgnunet-c1062075eddca49cfeaac8f7fd8c84e73198c2aa.tar.gz
gnunet-c1062075eddca49cfeaac8f7fd8c84e73198c2aa.zip
-wip error gns
Diffstat (limited to 'src/identity')
-rw-r--r--src/identity/plugin_rest_identity.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c
index 957a200b5..00835be7a 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -278,16 +278,16 @@ do_error (void *cls)
278 struct MHD_Response *resp; 278 struct MHD_Response *resp;
279 char *json_error; 279 char *json_error;
280 280
281 GNUNET_asprintf (&json_error, 281 if (NULL == handle->emsg)
282 "{\"error\": \"%s\"}", 282 handle->emsg = GNUNET_strdup("Unknown Error");
283 handle->emsg); 283
284 GNUNET_asprintf (&json_error, "{\"error\": \"%s\"}", handle->emsg);
284 handle->response_code = MHD_HTTP_OK; 285 handle->response_code = MHD_HTTP_OK;
286
285 resp = GNUNET_REST_create_response (json_error); 287 resp = GNUNET_REST_create_response (json_error);
286 handle->proc (handle->proc_cls, 288 handle->proc (handle->proc_cls, resp, handle->response_code);
287 resp,
288 handle->response_code);
289 cleanup_handle (handle); 289 cleanup_handle (handle);
290 GNUNET_free (json_error); 290 GNUNET_free(json_error);
291} 291}
292 292
293 293
@@ -335,7 +335,7 @@ get_ego_for_subsys (void *cls,
335 335
336 if (0 == json_array_size(json_root)) 336 if (0 == json_array_size(json_root))
337 { 337 {
338 json_decref(json_root); 338 json_decref(json_root);
339 handle->emsg = GNUNET_strdup("No identity matches results!"); 339 handle->emsg = GNUNET_strdup("No identity matches results!");
340 GNUNET_SCHEDULER_add_now (&do_error, handle); 340 GNUNET_SCHEDULER_add_now (&do_error, handle);
341 return; 341 return;
@@ -347,7 +347,7 @@ get_ego_for_subsys (void *cls,
347 347
348 json_array_foreach(json_root, index, json_ego ) 348 json_array_foreach(json_root, index, json_ego )
349 { 349 {
350 json_decref(json_ego); 350 json_decref(json_ego);
351 } 351 }
352 json_decref (json_root); 352 json_decref (json_root);
353 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 353 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);