adding missing error handling in libwaku (#3084)

This commit is contained in:
gabrielmer 2024-10-03 00:13:42 +03:00 committed by GitHub
parent e406673c46
commit 713aa66a63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 4 deletions

View File

@ -309,24 +309,27 @@ proc waku_start(
ctx: ptr WakuContext, callback: WakuCallBack, userData: pointer ctx: ptr WakuContext, callback: WakuCallBack, userData: pointer
): cint {.dynlib, exportc.} = ): cint {.dynlib, exportc.} =
checkLibwakuParams(ctx, callback, userData) checkLibwakuParams(ctx, callback, userData)
## TODO: handle the error
discard waku_thread.sendRequestToWakuThread( waku_thread
.sendRequestToWakuThread(
ctx, ctx,
RequestType.LIFECYCLE, RequestType.LIFECYCLE,
NodeLifecycleRequest.createShared(NodeLifecycleMsgType.START_NODE), NodeLifecycleRequest.createShared(NodeLifecycleMsgType.START_NODE),
) )
.handleRes(callback, userData)
proc waku_stop( proc waku_stop(
ctx: ptr WakuContext, callback: WakuCallBack, userData: pointer ctx: ptr WakuContext, callback: WakuCallBack, userData: pointer
): cint {.dynlib, exportc.} = ): cint {.dynlib, exportc.} =
checkLibwakuParams(ctx, callback, userData) checkLibwakuParams(ctx, callback, userData)
## TODO: handle the error waku_thread
discard waku_thread.sendRequestToWakuThread( .sendRequestToWakuThread(
ctx, ctx,
RequestType.LIFECYCLE, RequestType.LIFECYCLE,
NodeLifecycleRequest.createShared(NodeLifecycleMsgType.STOP_NODE), NodeLifecycleRequest.createShared(NodeLifecycleMsgType.STOP_NODE),
) )
.handleRes(callback, userData)
proc waku_relay_subscribe( proc waku_relay_subscribe(
ctx: ptr WakuContext, ctx: ptr WakuContext,