From 2aff804498413a10ffe976a0198babbd11cc5e50 Mon Sep 17 00:00:00 2001
From: "alexey.stratulat" <alexey.stratulat@demlabs.net>
Date: Thu, 12 Sep 2024 22:59:52 +0700
Subject: [PATCH] [*] Bug fix: Now for the global_db get_keys command, if no
 data is found in the specified group or the group is missing, an
 informational message will be displayed instead of an error.

---
 modules/net/dap_chain_node_cli_cmd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/net/dap_chain_node_cli_cmd.c b/modules/net/dap_chain_node_cli_cmd.c
index e8b1aa3c31..436ae78ca0 100644
--- a/modules/net/dap_chain_node_cli_cmd.c
+++ b/modules/net/dap_chain_node_cli_cmd.c
@@ -811,8 +811,10 @@ int com_global_db(int a_argc, char ** a_argv, void **a_str_reply)
 
         if (!l_objs || !l_objs_count)
         {
-            dap_json_rpc_error_add(DAP_CHAIN_NODE_CLI_COM_GLOBAL_DB_NO_DATA_IN_GROUP,"No data in group %s.", l_group_str);
-            return -DAP_CHAIN_NODE_CLI_COM_GLOBAL_DB_NO_DATA_IN_GROUP;
+            char *l_str_tmp = dap_strdup_printf("No data in group '%s' or group not found.", l_group_str);
+            json_object *l_jobj_msg = json_object_new_string(l_str_tmp);
+            json_object_array_add(*json_arr_reply, l_jobj_msg);
+            return DAP_CHAIN_NODE_CLI_COM_GLOBAL_DB_JSON_OK;
         }
 
         json_object* json_arr_keys = json_object_new_array();
-- 
GitLab