mirror of https://github.com/waku-org/nwaku.git
adding missing error handling in libwaku (#3084)
This commit is contained in:
parent
e406673c46
commit
713aa66a63
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue