From 713aa66a6388db20d34a391e96b53b3c62a17364 Mon Sep 17 00:00:00 2001 From: gabrielmer <101006718+gabrielmer@users.noreply.github.com> Date: Thu, 3 Oct 2024 00:13:42 +0300 Subject: [PATCH] adding missing error handling in libwaku (#3084) --- library/libwaku.nim | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/library/libwaku.nim b/library/libwaku.nim index f313d925f..e2a7909be 100644 --- a/library/libwaku.nim +++ b/library/libwaku.nim @@ -309,24 +309,27 @@ proc waku_start( ctx: ptr WakuContext, callback: WakuCallBack, userData: pointer ): cint {.dynlib, exportc.} = checkLibwakuParams(ctx, callback, userData) - ## TODO: handle the error - discard waku_thread.sendRequestToWakuThread( + + waku_thread + .sendRequestToWakuThread( ctx, RequestType.LIFECYCLE, NodeLifecycleRequest.createShared(NodeLifecycleMsgType.START_NODE), ) + .handleRes(callback, userData) proc waku_stop( ctx: ptr WakuContext, callback: WakuCallBack, userData: pointer ): cint {.dynlib, exportc.} = checkLibwakuParams(ctx, callback, userData) - ## TODO: handle the error - discard waku_thread.sendRequestToWakuThread( + waku_thread + .sendRequestToWakuThread( ctx, RequestType.LIFECYCLE, NodeLifecycleRequest.createShared(NodeLifecycleMsgType.STOP_NODE), ) + .handleRes(callback, userData) proc waku_relay_subscribe( ctx: ptr WakuContext,