aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/gnunet-namestore-fcfsd.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-10-23 15:00:54 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-10-23 15:00:54 +0900
commitbb81464ede13b1cba93cd031de466bbc8c18f04f (patch)
tree6fc675d02f89c9611afb371b5291bb0fd86eb59e /src/namestore/gnunet-namestore-fcfsd.c
parentb391cb1d41ad900385338936b655fc0699a61eca (diff)
downloadgnunet-bb81464ede13b1cba93cd031de466bbc8c18f04f.tar.gz
gnunet-bb81464ede13b1cba93cd031de466bbc8c18f04f.zip
NAMESTORE: Introduce GANA-managed error codes
Diffstat (limited to 'src/namestore/gnunet-namestore-fcfsd.c')
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c
index 4a9c6e874..857b16def 100644
--- a/src/namestore/gnunet-namestore-fcfsd.c
+++ b/src/namestore/gnunet-namestore-fcfsd.c
@@ -432,31 +432,24 @@ register_error_cb (void *cls)
432} 432}
433 433
434 434
435/**
436 * A name/key pair has been successfully registered, or maybe not.
437 *
438 * @param cls the connection
439 * @param status result of the operation
440 * @param emsg error message if any
441 */
442static void 435static void
443register_done_cb (void *cls, 436register_done_cb (void *cls,
444 int32_t status, 437 enum GNUNET_ErrorCode ec)
445 const char *emsg)
446{ 438{
447 struct RequestData *rd = cls; 439 struct RequestData *rd = cls;
448 440
449 MHD_resume_connection (rd->c); 441 MHD_resume_connection (rd->c);
450 rd->searching = NULL; 442 rd->searching = NULL;
451 443
452 if ((GNUNET_SYSERR == status) || (GNUNET_NO == status)) 444 if (GNUNET_EC_NONE != ec)
453 { 445 {
454 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 446 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
455 _ ("Failed to create record for `%s': %s\n"), 447 _ ("Failed to create record for `%s': %s\n"),
456 rd->register_name, 448 rd->register_name,
457 emsg); 449 GNUNET_ErrorCode_get_hint (ec));
458 rd->body = make_json ("error", "true", 450 rd->body = make_json ("error", "true",
459 "message", emsg, 451 "message",
452 GNUNET_ErrorCode_get_hint (ec),
460 NULL); 453 NULL);
461 rd->body_length = strlen (rd->body); 454 rd->body_length = strlen (rd->body);
462 rd->code = MHD_HTTP_INTERNAL_SERVER_ERROR; 455 rd->code = MHD_HTTP_INTERNAL_SERVER_ERROR;