mirror of
https://github.com/status-im/nim-json-rpc.git
synced 2025-02-24 18:28:10 +00:00
Fix Nim 1.6 regressions (#160)
This commit is contained in:
parent
07e4705b1f
commit
af12764436
@ -90,7 +90,7 @@ proc route*(router: RpcRouter, node: JsonNode): Future[StringOfJson] {.async, gc
|
||||
proc route*(router: RpcRouter, data: string): Future[string] {.async, gcsafe.} =
|
||||
## Route to RPC from string data. Data is expected to be able to be converted to Json.
|
||||
## Returns string of Json from RPC result/error node
|
||||
when (NimMajor, NimMinor) >= (1, 6):
|
||||
when defined(nimHasWarnBareExcept):
|
||||
{.warning[BareExcept]:off.}
|
||||
|
||||
let node =
|
||||
@ -101,7 +101,7 @@ proc route*(router: RpcRouter, data: string): Future[string] {.async, gcsafe.} =
|
||||
# TODO https://github.com/status-im/nimbus-eth2/issues/2430
|
||||
return string(wrapError(JSON_PARSE_ERROR, err.msg))
|
||||
|
||||
when (NimMajor, NimMinor) >= (1, 6):
|
||||
when defined(nimHasWarnBareExcept):
|
||||
{.warning[BareExcept]:on.}
|
||||
|
||||
return string(await router.route(node))
|
||||
|
Loading…
x
Reference in New Issue
Block a user